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

Commit

Permalink
Merge pull request #1389 from allisonvacanti/cmake_language_check
Browse files Browse the repository at this point in the history
Support building the test suite without CUDA language enabled.
  • Loading branch information
alliepiper authored Feb 19, 2021
2 parents df8afb8 + 2f1afb1 commit 720a5ac
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cmake/ThrustBuildTargetList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,23 @@ function(thrust_set_target_properties target_name host device dialect prefix)
_THRUST_PREFIX ${prefix}
)

get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
set(standard_features)
if (CUDA IN_LIST langs)
list(APPEND standard_features cuda_std_${dialect})
endif()
if (CXX IN_LIST langs)
list(APPEND standard_features cxx_std_${dialect})
endif()

get_target_property(type ${target_name} TYPE)
if (${type} STREQUAL "INTERFACE_LIBRARY")
target_compile_features(${target_name} INTERFACE
cxx_std_${dialect}
cuda_std_${dialect}
${standard_features}
)
else()
target_compile_features(${target_name} PUBLIC
cxx_std_${dialect}
cuda_std_${dialect}
${standard_features}
)
set_target_properties(${target_name}
PROPERTIES
Expand Down

0 comments on commit 720a5ac

Please sign in to comment.