summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-05-28 17:03:23 (GMT)
committerBrad King <brad.king@kitware.com>2024-05-28 18:36:42 (GMT)
commit5d93c421f1f9595fc8fc66f9071b4bf3589a4ad5 (patch)
treee8a6f68242a9383277bc5126756eb89446a5fe30
parent6b2171d94e6b098b9b8b9ca5b79e54db5671c184 (diff)
downloadCMake-5d93c421f1f9595fc8fc66f9071b4bf3589a4ad5.zip
CMake-5d93c421f1f9595fc8fc66f9071b4bf3589a4ad5.tar.gz
CMake-5d93c421f1f9595fc8fc66f9071b4bf3589a4ad5.tar.bz2
HIP: Populate CMAKE_HIP_KNOWN_FEATURES global property
Fixes: #26013
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst42
-rw-r--r--Help/variable/CMAKE_HIP_COMPILE_FEATURES.rst13
-rw-r--r--Source/cmState.cxx5
5 files changed, 62 insertions, 0 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index f37e72f..a7cf774 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -25,6 +25,7 @@ Properties of Global Scope
/prop_gbl/CMAKE_C_KNOWN_FEATURES
/prop_gbl/CMAKE_CUDA_KNOWN_FEATURES
/prop_gbl/CMAKE_CXX_KNOWN_FEATURES
+ /prop_gbl/CMAKE_HIP_KNOWN_FEATURES
/prop_gbl/CMAKE_ROLE
/prop_gbl/DEBUG_CONFIGURATIONS
/prop_gbl/DISABLED_FEATURES
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index b71e3d9..6400a93 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -590,6 +590,7 @@ Variables for Languages
/variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG
/variable/CMAKE_HIP_ARCHITECTURES
+ /variable/CMAKE_HIP_COMPILE_FEATURES
/variable/CMAKE_HIP_EXTENSIONS
/variable/CMAKE_HIP_PLATFORM
/variable/CMAKE_HIP_STANDARD
diff --git a/Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst
new file mode 100644
index 0000000..9d13c81
--- /dev/null
+++ b/Help/prop_gbl/CMAKE_HIP_KNOWN_FEATURES.rst
@@ -0,0 +1,42 @@
+CMAKE_HIP_KNOWN_FEATURES
+------------------------
+
+.. versionadded:: 3.30
+
+List of HIP features known to this version of CMake.
+
+The features listed in this global property may be known to be available to the
+HIP compiler. If the feature is available with the HIP compiler, it will
+be listed in the :variable:`CMAKE_HIP_COMPILE_FEATURES` variable.
+
+The features listed here may be used with the :command:`target_compile_features`
+command. See the :manual:`cmake-compile-features(7)` manual for information on
+compile features and a list of supported compilers.
+
+
+The features known to this version of CMake are:
+
+``hip_std_98``
+ Compiler mode is at least HIP/C++ 98.
+
+``hip_std_11``
+ Compiler mode is at least HIP/C++ 11.
+
+``hip_std_14``
+ Compiler mode is at least HIP/C++ 14.
+
+``hip_std_17``
+ Compiler mode is at least HIP/C++ 17.
+
+``hip_std_20``
+ Compiler mode is at least HIP/C++ 20.
+
+``hip_std_23``
+ Compiler mode is at least HIP/C++ 23.
+
+``hip_std_26``
+ .. versionadded:: 3.30
+
+ Compiler mode is at least HIP/C++ 26.
+
+.. include:: CMAKE_LANG_STD_FLAGS.txt
diff --git a/Help/variable/CMAKE_HIP_COMPILE_FEATURES.rst b/Help/variable/CMAKE_HIP_COMPILE_FEATURES.rst
new file mode 100644
index 0000000..d46d8c2
--- /dev/null
+++ b/Help/variable/CMAKE_HIP_COMPILE_FEATURES.rst
@@ -0,0 +1,13 @@
+CMAKE_HIP_COMPILE_FEATURES
+--------------------------
+
+.. versionadded:: 3.21
+
+List of features known to the HIP compiler
+
+These features are known to be available for use with the HIP compiler. This
+list is a subset of the features listed in the
+:prop_gbl:`CMAKE_HIP_KNOWN_FEATURES` global property.
+
+See the :manual:`cmake-compile-features(7)` manual for information on
+compile features and a list of supported compilers.
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index e05eb10..b716dc7 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -659,6 +659,11 @@ cmValue cmState::GetGlobalProperty(const std::string& prop)
&FOR_EACH_CUDA_FEATURE(STRING_LIST_ELEMENT)[1]);
return cmValue(s_out);
}
+ if (prop == "CMAKE_HIP_KNOWN_FEATURES") {
+ static const std::string s_out(
+ &FOR_EACH_HIP_FEATURE(STRING_LIST_ELEMENT)[1]);
+ return cmValue(s_out);
+ }
#undef STRING_LIST_ELEMENT
return this->GlobalProperties.GetPropertyValue(prop);