diff options
| author | Arkadiy Shapkin <arkady.shapkin@gmail.com> | 2017-05-06 12:55:19 +0300 |
|---|---|---|
| committer | Arkadiy Shapkin <arkady.shapkin@gmail.com> | 2017-05-09 01:14:09 +0300 |
| commit | 0aa8055fbd8e721f1829d73f92eaf3868bd70a36 (patch) | |
| tree | b802dd2e9702e3c84542e86ab20af13d5bf4b2fe /ports/folly/fix-cmakelists.patch | |
| parent | 8fa5f3fd68ee6673e810f4b425c3e61dfad342fa (diff) | |
| download | vcpkg-0aa8055fbd8e721f1829d73f92eaf3868bd70a36.tar.gz vcpkg-0aa8055fbd8e721f1829d73f92eaf3868bd70a36.zip | |
[folly] Initial commit for Facebook Folly library
Diffstat (limited to 'ports/folly/fix-cmakelists.patch')
| -rw-r--r-- | ports/folly/fix-cmakelists.patch | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/ports/folly/fix-cmakelists.patch b/ports/folly/fix-cmakelists.patch new file mode 100644 index 000000000..9f5700dbb --- /dev/null +++ b/ports/folly/fix-cmakelists.patch @@ -0,0 +1,89 @@ +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 211c6fbf..988225a2 100755 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -11,8 +11,8 @@ find_package(Boost 1.55.0 MODULE + REQUIRED + ) + find_package(DoubleConversion MODULE REQUIRED) +-find_package(GFlags MODULE REQUIRED) +-find_package(GLog MODULE REQUIRED) ++find_package(gflags CONFIG REQUIRED) ++find_package(glog CONFIG REQUIRED) + find_package(LibEvent MODULE REQUIRED) + find_package(OpenSSL MODULE REQUIRED) + find_package(PThread MODULE) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 38886d65..4c796eac 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,15 +1,8 @@ + cmake_minimum_required(VERSION 3.4.0 FATAL_ERROR) + +-# Unfortunately, CMake doesn't easily provide us a way to merge static +-# libraries, which is what we want to do to generate the main folly library, so +-# we do a bit of a workaround here to inject a property into the generated +-# project files that will only get enabled for the folly target. Ugly, but +-# the alternatives are far, far worse. + if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio 15( 2017)? Win64") +- set(CMAKE_GENERATOR_TOOLSET "v141</PlatformToolset></PropertyGroup><ItemDefinitionGroup Condition=\"'$(ProjectName)'=='folly'\"><ProjectReference><LinkLibraryDependencies>true</LinkLibraryDependencies></ProjectReference></ItemDefinitionGroup><PropertyGroup><PlatformToolset>v141") + set(MSVC_IS_2017 ON) + elseif ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 14 2015 Win64") +- set(CMAKE_GENERATOR_TOOLSET "v140</PlatformToolset></PropertyGroup><ItemDefinitionGroup Condition=\"'$(ProjectName)'=='folly'\"><ProjectReference><LinkLibraryDependencies>true</LinkLibraryDependencies></ProjectReference></ItemDefinitionGroup><PropertyGroup><PlatformToolset>v140") + set(MSVC_IS_2017 OFF) + else() + message(FATAL_ERROR "This build script only supports building Folly on 64-bit Windows with Visual Studio 2015 or Visual Studio 2017.") +@@ -122,7 +115,8 @@ add_library(folly_base STATIC + ) + auto_source_group(folly ${FOLLY_DIR} ${files} ${hfiles}) + apply_folly_compile_options_to_target(folly_base) +-target_include_directories(folly_base PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) ++target_include_directories(folly_base PUBLIC ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) + # Add the generated files to the correct source group. + source_group("folly" FILES ${CMAKE_CURRENT_BINARY_DIR}/folly/folly-config.h) + source_group("folly\\build" FILES +@@ -133,10 +127,9 @@ source_group("folly\\build" FILES + ) + + target_include_directories(folly_base +- PUBLIC ++ PRIVATE + ${DOUBLE_CONVERSION_INCLUDE_DIR} + ${LIBGFLAGS_INCLUDE_DIR} +- ${LIBGLOG_INCLUDE_DIR} + ${LIBEVENT_INCLUDE_DIR} + ) + target_link_libraries(folly_base +@@ -151,13 +144,13 @@ target_link_libraries(folly_base + ${DOUBLE_CONVERSION_LIBRARY} + ${LIBEVENT_LIB} + ${LIBGFLAGS_LIBRARY} +- ${LIBGLOG_LIBRARY} ++ glog::glog + OpenSSL::SSL + OpenSSL::Crypto + Ws2_32.lib + ) + if (FOLLY_HAVE_PTHREAD) +- target_include_directories(folly_base PUBLIC ${LIBPTHREAD_INCLUDE_DIRS}) ++ target_include_directories(folly_base PRIVATE ${LIBPTHREAD_INCLUDE_DIRS}) + target_link_libraries(folly_base PUBLIC ${LIBPTHREAD_LIBRARIES}) + endif() + +@@ -199,13 +192,10 @@ add_library(folly ${CMAKE_CURRENT_BINARY_DIR}/folly_dep.cpp) + apply_folly_compile_options_to_target(folly) + source_group("" FILES ${CMAKE_CURRENT_BINARY_DIR}/folly_dep.cpp) + +-# Rather than list the dependencies in two places, we apply them directly on +-# the folly_base target and then copy them over to the folly target. +-get_target_property(FOLLY_LINK_LIBRARIES folly_base INTERFACE_LINK_LIBRARIES) +-target_link_libraries(folly PUBLIC ${FOLLY_LINK_LIBRARIES}) ++target_link_libraries(folly PUBLIC folly_base) + target_include_directories(folly PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) + +-install(TARGETS folly ++install(TARGETS folly folly_base + EXPORT folly + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib |
