aboutsummaryrefslogtreecommitdiff
path: root/ports/rocksdb/fix-building-both-static-and-shared.patch
diff options
context:
space:
mode:
authoratkawa7 <atkawa7@yahoo.com>2017-06-28 21:46:53 -0700
committeratkawa7 <atkawa7@yahoo.com>2017-06-28 21:46:53 -0700
commit49d00f460453fbbedd9cdee635720d0bc84de9cb (patch)
tree92e36227240921edc00a6ce3823e72aaa449e0b3 /ports/rocksdb/fix-building-both-static-and-shared.patch
parent7a6d530a8c0b58d3b32b81acfd5f060675d2653d (diff)
downloadvcpkg-49d00f460453fbbedd9cdee635720d0bc84de9cb.tar.gz
vcpkg-49d00f460453fbbedd9cdee635720d0bc84de9cb.zip
[rocksdb] fixed third party deps
Diffstat (limited to 'ports/rocksdb/fix-building-both-static-and-shared.patch')
-rw-r--r--ports/rocksdb/fix-building-both-static-and-shared.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/ports/rocksdb/fix-building-both-static-and-shared.patch b/ports/rocksdb/fix-building-both-static-and-shared.patch
new file mode 100644
index 000000000..78b863643
--- /dev/null
+++ b/ports/rocksdb/fix-building-both-static-and-shared.patch
@@ -0,0 +1,91 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cbbde8e..cb19649 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -315,10 +315,13 @@ endif()
+
+ include_directories(${PROJECT_SOURCE_DIR})
+ include_directories(${PROJECT_SOURCE_DIR}/include)
+-include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src)
++
+ find_package(Threads REQUIRED)
+
+-add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest)
++if(BUILD_TEST)
++ include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src)
++ add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest)
++endif()
+
+ # Main library source code
+
+@@ -574,22 +577,28 @@ if(WITH_LIBRADOS)
+ list(APPEND THIRDPARTY_LIBS rados)
+ endif()
+
+-add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES})
+-target_link_libraries(${ROCKSDB_STATIC_LIB}
++if(BUILD_STATIC_LIBRARY)
++ add_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES})
++ target_link_libraries(${ROCKSDB_STATIC_LIB}
+ ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
+-
+-if(WIN32)
+- add_library(${ROCKSDB_IMPORT_LIB} SHARED ${SOURCES})
+- target_link_libraries(${ROCKSDB_IMPORT_LIB}
+- ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
+- set_target_properties(${ROCKSDB_IMPORT_LIB} PROPERTIES
+- COMPILE_DEFINITIONS "ROCKSDB_DLL;ROCKSDB_LIBRARY_EXPORTS")
+ if(MSVC)
+ set_target_properties(${ROCKSDB_STATIC_LIB} PROPERTIES
+- COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/${ROCKSDB_STATIC_LIB}.pdb")
++ COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/${ROCKSDB_STATIC_LIB}.pdb")
++ endif()
++ set(INSTALL_TARGETS ${INSTALL_TARGETS} ${ROCKSDB_STATIC_LIB})
++else()
++ if(WIN32)
++ add_library(${ROCKSDB_IMPORT_LIB} SHARED ${SOURCES})
++ target_link_libraries(${ROCKSDB_IMPORT_LIB}
++ ${THIRDPARTY_LIBS} ${SYSTEM_LIBS})
+ set_target_properties(${ROCKSDB_IMPORT_LIB} PROPERTIES
++ COMPILE_DEFINITIONS "ROCKSDB_DLL;ROCKSDB_LIBRARY_EXPORTS")
++ if(MSVC)
++ set_target_properties(${ROCKSDB_IMPORT_LIB} PROPERTIES
+ COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/${ROCKSDB_IMPORT_LIB}.pdb")
++ endif()
+ endif()
++ set(INSTALL_TARGETS ${INSTALL_TARGETS} ${ROCKSDB_IMPORT_LIB})
+ endif()
+
+ option(WITH_JNI "build with JNI" OFF)
+@@ -600,6 +609,7 @@ else()
+ message(STATUS "JNI library is disabled")
+ endif()
+
++if(BUILD_TEST)
+ set(TESTS
+ cache/cache_test.cc
+ cache/lru_cache_test.cc
+@@ -810,6 +820,7 @@ foreach(sourcefile ${C_TEST_EXES})
+ add_dependencies(check ${exename}${ARTIFACT_SUFFIX})
+ endforeach(sourcefile ${C_TEST_EXES})
+ add_subdirectory(tools)
++endif()
+
+ # Installation and packaging for Linux
+ if(NOT WIN32)
+@@ -819,4 +830,15 @@ install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/rocksdb/"
+ COMPONENT devel
+ DESTINATION include/rocksdb)
+ set(CMAKE_INSTALL_PREFIX /usr)
++else()
++ install(
++ TARGETS ${INSTALL_TARGETS}
++ RUNTIME DESTINATION bin
++ LIBRARY DESTINATION lib
++ ARCHIVE DESTINATION lib
++ )
++endif()
++
++if(NOT DISABLE_INSTALL_HEADERS)
++ install(DIRECTORY "include/rocksdb/" DESTINATION include/rocksdb)
+ endif()