aboutsummaryrefslogtreecommitdiff
path: root/ports/folly
diff options
context:
space:
mode:
authorStefano Sinigardi <stesinigardi@hotmail.com>2020-10-20 02:18:39 +0200
committerGitHub <noreply@github.com>2020-10-19 17:18:39 -0700
commiteb183171d257f4b3dd49b9f919627d2d54071f66 (patch)
tree1c543a44df69b3cae7d6af0140141ce8cc79e077 /ports/folly
parentbb7d4f29f073398d591619eb57c8a2065ee7a418 (diff)
downloadvcpkg-eb183171d257f4b3dd49b9f919627d2d54071f66.tar.gz
vcpkg-eb183171d257f4b3dd49b9f919627d2d54071f66.zip
[cmake] upgrade to 3.18 (#12612)
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Diffstat (limited to 'ports/folly')
-rw-r--r--ports/folly/CONTROL2
-rw-r--r--ports/folly/fix-cmake-3.18.patch48
-rw-r--r--ports/folly/portfile.cmake1
3 files changed, 50 insertions, 1 deletions
diff --git a/ports/folly/CONTROL b/ports/folly/CONTROL
index 302e7a924..f5d2154cc 100644
--- a/ports/folly/CONTROL
+++ b/ports/folly/CONTROL
@@ -1,6 +1,6 @@
Source: folly
Version: 2019.10.21.00
-Port-Version: 4
+Port-Version: 5
Homepage: https://github.com/facebook/folly
Description: An open-source C++ library developed and used at Facebook. The library is UNSTABLE on Windows
Build-Depends: openssl, libevent, double-conversion, glog, gflags, boost-chrono, boost-context, boost-conversion, boost-crc, boost-date-time, boost-filesystem, boost-multi-index, boost-program-options, boost-regex, boost-system, boost-thread, boost-smart-ptr
diff --git a/ports/folly/fix-cmake-3.18.patch b/ports/folly/fix-cmake-3.18.patch
new file mode 100644
index 000000000..c4ba62c76
--- /dev/null
+++ b/ports/folly/fix-cmake-3.18.patch
@@ -0,0 +1,48 @@
+diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake
+index f8701b4..00a1e75 100644
+--- a/CMake/GenPkgConfig.cmake
++++ b/CMake/GenPkgConfig.cmake
+@@ -92,7 +92,19 @@ function(gen_pkgconfig_vars)
+
+ # Set the output variables
+ string(REPLACE ";" " " cflags "${cflags}")
+- set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE)
+ string(REPLACE ";" " " private_libs "${private_libs}")
++
++ # Since CMake 3.18 FindThreads may include a generator expression requiring
++ # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS.
++ # Before CMake 3.19 there's no way to solve this in a general way, so we
++ # work around the specific case. See #1414 and CMake bug #21074.
++ if(CMAKE_VERSION VERSION_LESS 3.19)
++ string(REPLACE
++ "<COMPILE_LANG_AND_ID:CUDA,NVIDIA>" "<COMPILE_LANGUAGE:CUDA>"
++ cflags "${cflags}"
++ )
++ endif()
++
++ set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE)
+ set("${var_prefix}_PRIVATE_LIBS" "${private_libs}" PARENT_SCOPE)
+ endfunction()
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2de9298..950dd76 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -414,10 +414,18 @@ configure_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen
+ @ONLY
+ )
++
++# Specify target to allow resolving generator expressions requiring
++# a target for CMake >=3.19. See #1414.
++if(NOT CMAKE_VERSION VERSION_LESS 3.19)
++ set(target_arg TARGET folly_deps)
++endif()
++
+ file(
+ GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc
+ INPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen
++ ${target_arg}
+ )
+ install(
+ FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc
diff --git a/ports/folly/portfile.cmake b/ports/folly/portfile.cmake
index 3853569d9..07d0093cb 100644
--- a/ports/folly/portfile.cmake
+++ b/ports/folly/portfile.cmake
@@ -22,6 +22,7 @@ vcpkg_from_github(
boost-1.70.patch
fix-addbit.patch
folly_c3861.patch
+ fix-cmake-3.18.patch # Remove this patch on the next update
)
file(COPY