summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCompileFeatures.cmake
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2020-08-28 15:03:39 -0400
committerZack Galbreath <zack.galbreath@kitware.com>2021-06-07 19:25:33 +0000
commitb50bfc89131e55685aa41146254b37d26049b4d5 (patch)
treee6ed45ba63b75decf4c9436fac6139174850370b /Modules/CMakeDetermineCompileFeatures.cmake
parentff0d2858e1e47af8e849318b411b1fbd8579a053 (diff)
downloadcmake-b50bfc89131e55685aa41146254b37d26049b4d5.tar.gz
HIP: Add language to CMake
Diffstat (limited to 'Modules/CMakeDetermineCompileFeatures.cmake')
-rw-r--r--Modules/CMakeDetermineCompileFeatures.cmake56
1 files changed, 56 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompileFeatures.cmake b/Modules/CMakeDetermineCompileFeatures.cmake
index ee7fedba4a..a08e597f87 100644
--- a/Modules/CMakeDetermineCompileFeatures.cmake
+++ b/Modules/CMakeDetermineCompileFeatures.cmake
@@ -166,6 +166,62 @@ function(cmake_determine_compile_features lang)
message(CHECK_PASS "done")
+ elseif(lang STREQUAL HIP AND COMMAND cmake_record_hip_compile_features)
+ message(CHECK_START "Detecting ${lang} compile features")
+
+ set(CMAKE_HIP98_COMPILE_FEATURES)
+ set(CMAKE_HIP11_COMPILE_FEATURES)
+ set(CMAKE_HIP14_COMPILE_FEATURES)
+ set(CMAKE_HIP17_COMPILE_FEATURES)
+ set(CMAKE_HIP20_COMPILE_FEATURES)
+ set(CMAKE_HIP23_COMPILE_FEATURES)
+
+ include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
+
+ cmake_record_hip_compile_features()
+
+ if(NOT _result EQUAL 0)
+ message(CHECK_FAIL "failed")
+ return()
+ endif()
+
+ if (CMAKE_HIP20_COMPILE_FEATURES AND CMAKE_HIP23_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP17_COMPILE_FEATURES AND CMAKE_HIP20_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP14_COMPILE_FEATURES AND CMAKE_HIP17_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP14_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP11_COMPILE_FEATURES AND CMAKE_HIP14_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP14_COMPILE_FEATURES ${CMAKE_HIP11_COMPILE_FEATURES})
+ endif()
+ if (CMAKE_HIP98_COMPILE_FEATURES AND CMAKE_HIP11_COMPILE_FEATURES)
+ list(REMOVE_ITEM CMAKE_HIP11_COMPILE_FEATURES ${CMAKE_HIP98_COMPILE_FEATURES})
+ endif()
+
+ if(NOT CMAKE_HIP_COMPILE_FEATURES)
+ set(CMAKE_HIP_COMPILE_FEATURES
+ ${CMAKE_HIP98_COMPILE_FEATURES}
+ ${CMAKE_HIP11_COMPILE_FEATURES}
+ ${CMAKE_HIP14_COMPILE_FEATURES}
+ ${CMAKE_HIP17_COMPILE_FEATURES}
+ ${CMAKE_HIP20_COMPILE_FEATURES}
+ ${CMAKE_HIP23_COMPILE_FEATURES}
+ )
+ endif()
+
+ set(CMAKE_HIP_COMPILE_FEATURES ${CMAKE_HIP_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP98_COMPILE_FEATURES ${CMAKE_HIP98_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP11_COMPILE_FEATURES ${CMAKE_HIP11_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP14_COMPILE_FEATURES ${CMAKE_HIP14_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP17_COMPILE_FEATURES ${CMAKE_HIP17_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP20_COMPILE_FEATURES ${CMAKE_HIP20_COMPILE_FEATURES} PARENT_SCOPE)
+ set(CMAKE_HIP23_COMPILE_FEATURES ${CMAKE_HIP23_COMPILE_FEATURES} PARENT_SCOPE)
+
+ message(CHECK_PASS "done")
+
endif()
endfunction()