diff options
author | Allison Vacanti <alliepiper16@gmail.com> | 2022-08-30 23:00:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 23:00:32 +0300 |
commit | 786e5aaee354e43a4c09dc88d9ba9fb0c1aca2a5 (patch) | |
tree | fd2740906534bcf0df2cddaf78e4ecae4ec5a21f | |
parent | 512272c37179390b6b7ea92471c2f07491357980 (diff) | |
parent | 73a461625acd40cb83f27f5213ad4fd57a214dca (diff) |
Merge pull request #1781 from allisonvacanti/c++20_fix_backport2.0.0-rc2
Various CMake fixes for new build features
-rw-r--r-- | cmake/ThrustBuildCompilerTargets.cmake | 7 | ||||
-rw-r--r-- | cmake/ThrustBuildTargetList.cmake | 8 | ||||
-rw-r--r-- | thrust/cmake/FindTBB.cmake | 3 |
3 files changed, 11 insertions, 7 deletions
diff --git a/cmake/ThrustBuildCompilerTargets.cmake b/cmake/ThrustBuildCompilerTargets.cmake index bf0b31ed..aed0ec17 100644 --- a/cmake/ThrustBuildCompilerTargets.cmake +++ b/cmake/ThrustBuildCompilerTargets.cmake @@ -6,11 +6,9 @@ # - Interface target providing compiler-specific options needed to build # Thrust's tests, examples, etc. # -# thrust.compiler_interface_cpp11 -# thrust.compiler_interface_cpp14 -# thrust.compiler_interface_cpp17 +# thrust.compiler_interface_cppXX # - Interface targets providing compiler-specific options that should only be -# applied to certain dialects of C++. +# applied to certain dialects of C++. May not be defined for all dialects. # # thrust.promote_cudafe_warnings # - Interface target that adds warning promotion for NVCC cudafe invocations. @@ -175,7 +173,6 @@ function(thrust_build_compiler_targets) # These targets are used for dialect-specific options: add_library(thrust.compiler_interface_cpp11 INTERFACE) add_library(thrust.compiler_interface_cpp14 INTERFACE) - add_library(thrust.compiler_interface_cpp17 INTERFACE) if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # C4127: conditional expression is constant diff --git a/cmake/ThrustBuildTargetList.cmake b/cmake/ThrustBuildTargetList.cmake index 3868287b..f4adaf54 100644 --- a/cmake/ThrustBuildTargetList.cmake +++ b/cmake/ThrustBuildTargetList.cmake @@ -163,9 +163,15 @@ function(_thrust_add_target_to_target_list target_name host device dialect prefi target_link_libraries(${target_name} INTERFACE thrust.compiler_interface - thrust.compiler_interface_cpp${dialect} ) + # dialect-specific interface: + if (TARGET thrust.compiler_interface_cpp${dialect}) + target_link_libraries(${target_name} INTERFACE + thrust.compiler_interface_cpp${dialect} + ) + endif() + # Workaround Github issue #1174. cudafe promote TBB header warnings to # errors, even when they're -isystem includes. if ((NOT host STREQUAL "TBB") OR (NOT device STREQUAL "CUDA")) diff --git a/thrust/cmake/FindTBB.cmake b/thrust/cmake/FindTBB.cmake index 2ee350d3..01e53d5e 100644 --- a/thrust/cmake/FindTBB.cmake +++ b/thrust/cmake/FindTBB.cmake @@ -236,11 +236,12 @@ if (WIN32 AND MSVC) set(COMPILER_PREFIX "vc11") elseif(MSVC_VERSION EQUAL 1800) set(COMPILER_PREFIX "vc12") - elseif(MSVC_VERSION GREATER_EQUAL 1900 AND MSVC_VERSION LESS_EQUAL 1929) + elseif(MSVC_VERSION GREATER_EQUAL 1900 AND MSVC_VERSION LESS_EQUAL 1939) # 1900-1925 actually spans three Visual Studio versions: # 1900 = VS 14.0 (v140 toolset) a.k.a. MSVC 2015 # 1910-1919 = VS 15.0 (v141 toolset) a.k.a. MSVC 2017 # 1920-1929 = VS 16.0 (v142 toolset) a.k.a. MSVC 2019 + # 1930-1939 = VS 17.0 (v143 toolset) a.k.a. MSVC 2022 # # But these are binary compatible and TBB's open source distribution only # ships a single vs14 lib (as of 2020.0) |