summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-05 15:16:42 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-05 15:16:53 (GMT)
commit769be838cb9c952e6f3d4e3030dea291e542d69a (patch)
treea8de9803caa0ecbb2970b26490c32402e4312375 /Tests
parent159872ab8bbb06f671ea3d976e8cd3f2e350bd55 (diff)
parentce9c6d0994799a64d1cea4eac0492d27ded74b75 (diff)
downloadCMake-769be838cb9c952e6f3d4e3030dea291e542d69a.zip
CMake-769be838cb9c952e6f3d4e3030dea291e542d69a.tar.gz
CMake-769be838cb9c952e6f3d4e3030dea291e542d69a.tar.bz2
Merge topic 'check_language_propagate_hip_platform'
ce9c6d0994 HIP: Propagate CMAKE_HIP_PLATFORM from/to the test project in check_language 9ba3fc91e5 HIP: Really forward CMAKE_HIP_HOST_COMPILER in check_language(HIP) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9121
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt7
-rw-r--r--Tests/CMakeOnly/CheckLanguageHIPPlatform/CMakeLists.txt17
-rw-r--r--Tests/CMakeOnly/CheckLanguageHIPPlatform2/CMakeLists.txt14
3 files changed, 38 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index a41b44e..30cabf1 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -25,6 +25,13 @@ add_CMakeOnly_test(CheckCXXSymbolExists)
add_CMakeOnly_test(CheckCXXCompilerFlag)
add_CMakeOnly_test(CheckLanguage)
+if (CMake_TEST_HIP)
+ set_property(TEST CMakeOnly.CheckLanguage APPEND PROPERTY LABELS "HIP")
+ add_CMakeOnly_test(CheckLanguageHIPPlatform)
+ set_property(TEST CMakeOnly.CheckLanguageHIPPlatform APPEND PROPERTY LABELS "HIP")
+ add_CMakeOnly_test(CheckLanguageHIPPlatform2)
+ set_property(TEST CMakeOnly.CheckLanguageHIPPlatform2 APPEND PROPERTY LABELS "HIP")
+endif()
add_CMakeOnly_test(CheckStructHasMember)
diff --git a/Tests/CMakeOnly/CheckLanguageHIPPlatform/CMakeLists.txt b/Tests/CMakeOnly/CheckLanguageHIPPlatform/CMakeLists.txt
new file mode 100644
index 0000000..03b8aa0
--- /dev/null
+++ b/Tests/CMakeOnly/CheckLanguageHIPPlatform/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required (VERSION 3.28)
+project(CheckLanguageHIPPlatform NONE)
+include(CheckLanguage)
+
+check_language(HIP)
+
+if(NOT DEFINED CMAKE_HIP_COMPILER)
+ message(FATAL_ERROR "check_language did not set result")
+endif()
+
+if (NOT CMAKE_HIP_COMPILER)
+ message(FATAL_ERROR "check_language should not fail!")
+endif()
+
+if (NOT DEFINED CMAKE_HIP_PLATFORM)
+ message(FATAL_ERROR "check_language did not set CMAKE_HIP_PLATFORM!")
+endif()
diff --git a/Tests/CMakeOnly/CheckLanguageHIPPlatform2/CMakeLists.txt b/Tests/CMakeOnly/CheckLanguageHIPPlatform2/CMakeLists.txt
new file mode 100644
index 0000000..f251c49
--- /dev/null
+++ b/Tests/CMakeOnly/CheckLanguageHIPPlatform2/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required (VERSION 3.28)
+project(CheckLanguageHIPPlatform2 NONE)
+include(CheckLanguage)
+
+set(CMAKE_HIP_PLATFORM "not-a-hip-platform" CACHE STRING "")
+check_language(HIP)
+
+if(NOT DEFINED CMAKE_HIP_COMPILER)
+ message(FATAL_ERROR "check_language did not set result")
+endif()
+
+if (CMAKE_HIP_COMPILER)
+ message(FATAL_ERROR "check_language should have failed")
+endif()