Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit 786e5aa

Browse files
authoredAug 30, 2022
Merge pull request #1781 from allisonvacanti/c++20_fix_backport
Various CMake fixes for new build features
2 parents 512272c + 73a4616 commit 786e5aa

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed
 

‎cmake/ThrustBuildCompilerTargets.cmake

+2-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
# - Interface target providing compiler-specific options needed to build
77
# Thrust's tests, examples, etc.
88
#
9-
# thrust.compiler_interface_cpp11
10-
# thrust.compiler_interface_cpp14
11-
# thrust.compiler_interface_cpp17
9+
# thrust.compiler_interface_cppXX
1210
# - Interface targets providing compiler-specific options that should only be
13-
# applied to certain dialects of C++.
11+
# applied to certain dialects of C++. May not be defined for all dialects.
1412
#
1513
# thrust.promote_cudafe_warnings
1614
# - Interface target that adds warning promotion for NVCC cudafe invocations.
@@ -175,7 +173,6 @@ function(thrust_build_compiler_targets)
175173
# These targets are used for dialect-specific options:
176174
add_library(thrust.compiler_interface_cpp11 INTERFACE)
177175
add_library(thrust.compiler_interface_cpp14 INTERFACE)
178-
add_library(thrust.compiler_interface_cpp17 INTERFACE)
179176

180177
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
181178
# C4127: conditional expression is constant

‎cmake/ThrustBuildTargetList.cmake

+7-1
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,15 @@ function(_thrust_add_target_to_target_list target_name host device dialect prefi
163163

164164
target_link_libraries(${target_name} INTERFACE
165165
thrust.compiler_interface
166-
thrust.compiler_interface_cpp${dialect}
167166
)
168167

168+
# dialect-specific interface:
169+
if (TARGET thrust.compiler_interface_cpp${dialect})
170+
target_link_libraries(${target_name} INTERFACE
171+
thrust.compiler_interface_cpp${dialect}
172+
)
173+
endif()
174+
169175
# Workaround Github issue #1174. cudafe promote TBB header warnings to
170176
# errors, even when they're -isystem includes.
171177
if ((NOT host STREQUAL "TBB") OR (NOT device STREQUAL "CUDA"))

‎thrust/cmake/FindTBB.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,12 @@ if (WIN32 AND MSVC)
236236
set(COMPILER_PREFIX "vc11")
237237
elseif(MSVC_VERSION EQUAL 1800)
238238
set(COMPILER_PREFIX "vc12")
239-
elseif(MSVC_VERSION GREATER_EQUAL 1900 AND MSVC_VERSION LESS_EQUAL 1929)
239+
elseif(MSVC_VERSION GREATER_EQUAL 1900 AND MSVC_VERSION LESS_EQUAL 1939)
240240
# 1900-1925 actually spans three Visual Studio versions:
241241
# 1900 = VS 14.0 (v140 toolset) a.k.a. MSVC 2015
242242
# 1910-1919 = VS 15.0 (v141 toolset) a.k.a. MSVC 2017
243243
# 1920-1929 = VS 16.0 (v142 toolset) a.k.a. MSVC 2019
244+
# 1930-1939 = VS 17.0 (v143 toolset) a.k.a. MSVC 2022
244245
#
245246
# But these are binary compatible and TBB's open source distribution only
246247
# ships a single vs14 lib (as of 2020.0)

0 commit comments

Comments
 (0)
This repository has been archived.