summaryrefslogtreecommitdiff
path: root/Modules/Internal/FeatureTesting.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-11-01 08:12:05 -0400
committerRobert Maynard <robert.maynard@kitware.com>2019-12-10 17:56:48 -0500
commit2467a2b3184595a87e93db510408fc14ddbaf3b9 (patch)
tree37e35f4a3c821634cc18c6cd8df8acf2391d4f5c /Modules/Internal/FeatureTesting.cmake
parentf62c674202045f877eaed9da0f9cbe2046452b40 (diff)
downloadcmake-2467a2b3184595a87e93db510408fc14ddbaf3b9.tar.gz
CUDA: Add cuda meta-features (e.g. ``cuda_std_11``) support
Diffstat (limited to 'Modules/Internal/FeatureTesting.cmake')
-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 75be473f39..72d96b33fc 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()