summaryrefslogtreecommitdiffstats
path: root/Modules/Internal
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-12-12 16:57:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-12-12 16:57:18 (GMT)
commit4fb9c880425ade41735951347d4e7d004a4e1e47 (patch)
tree7792f6261e1c88c812b679633eab50fde7f27a90 /Modules/Internal
parentbd855ffb5576c7ab2b3281e96a1aebaf825f9e97 (diff)
parent2467a2b3184595a87e93db510408fc14ddbaf3b9 (diff)
downloadCMake-4fb9c880425ade41735951347d4e7d004a4e1e47.zip
CMake-4fb9c880425ade41735951347d4e7d004a4e1e47.tar.gz
CMake-4fb9c880425ade41735951347d4e7d004a4e1e47.tar.bz2
Merge topic 'add_cuda_meta_compiler_features'
2467a2b318 CUDA: Add cuda meta-features (e.g. ``cuda_std_11``) support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3992
Diffstat (limited to 'Modules/Internal')
-rw-r--r--Modules/Internal/FeatureTesting.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake
index 75be473..72d96b3 100644
--- a/Modules/Internal/FeatureTesting.cmake
+++ b/Modules/Internal/FeatureTesting.cmake
@@ -89,6 +89,16 @@ macro(_record_compiler_features_cxx std)
unset(lang_level_has_features)
endmacro()
+macro(_record_compiler_features_cuda std)
+ list(APPEND CMAKE_CUDA${std}_COMPILE_FEATURES cuda_std_${std})
+
+ get_property(lang_level_has_features GLOBAL PROPERTY CMAKE_CUDA${std}_KNOWN_FEATURES)
+ if(lang_level_has_features)
+ _record_compiler_features(CUDA "${CMAKE_CUDA${std}_STANDARD_COMPILE_OPTION}" CMAKE_CUDA${std}_COMPILE_FEATURES)
+ endif()
+ unset(lang_level_has_features)
+endmacro()
+
macro(_has_compiler_features lang level compile_flags feature_list)
# presume all known features are supported
get_property(known_features GLOBAL PROPERTY CMAKE_${lang}${level}_KNOWN_FEATURES)
@@ -103,3 +113,7 @@ macro(_has_compiler_features_cxx std)
list(APPEND CMAKE_CXX${std}_COMPILE_FEATURES cxx_std_${std})
_has_compiler_features(CXX ${std} "${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}" CMAKE_CXX${std}_COMPILE_FEATURES)
endmacro()
+macro(_has_compiler_features_cuda std)
+ list(APPEND CMAKE_CUDA${std}_COMPILE_FEATURES cuda_std_${std})
+ _has_compiler_features(CUDA ${std} "${CMAKE_CUDA${std}_STANDARD_COMPILE_OPTION}" CMAKE_CUDA${std}_COMPILE_FEATURES)
+endmacro()