-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
- Loading branch information
1 parent
bb7d4f2
commit eb18317
Showing
17 changed files
with
94 additions
and
6,106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.