Skip to content

Commit 2f1afb1

Browse files
committed
Support building the test suite without CUDA language enabled.
1 parent df8afb8 commit 2f1afb1

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

cmake/ThrustBuildTargetList.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,23 @@ function(thrust_set_target_properties target_name host device dialect prefix)
6060
_THRUST_PREFIX ${prefix}
6161
)
6262

63+
get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
64+
set(standard_features)
65+
if (CUDA IN_LIST langs)
66+
list(APPEND standard_features cuda_std_${dialect})
67+
endif()
68+
if (CXX IN_LIST langs)
69+
list(APPEND standard_features cxx_std_${dialect})
70+
endif()
71+
6372
get_target_property(type ${target_name} TYPE)
6473
if (${type} STREQUAL "INTERFACE_LIBRARY")
6574
target_compile_features(${target_name} INTERFACE
66-
cxx_std_${dialect}
67-
cuda_std_${dialect}
75+
${standard_features}
6876
)
6977
else()
7078
target_compile_features(${target_name} PUBLIC
71-
cxx_std_${dialect}
72-
cuda_std_${dialect}
79+
${standard_features}
7380
)
7481
set_target_properties(${target_name}
7582
PROPERTIES

0 commit comments

Comments
 (0)