summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCompilerId.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-09-13 17:31:28 +0000
committerBrad King <brad.king@kitware.com>2021-09-16 15:33:47 -0400
commita71f0fc9c7762a06d0bfdd64d0d490919e12357a (patch)
tree89468eda1f91241b97d97aa60aad833152aea6e8 /Modules/CMakeDetermineCompilerId.cmake
parentb125e9809a1a3f3e28fc1682c8a33c3a928f79b5 (diff)
downloadcmake-a71f0fc9c7762a06d0bfdd64d0d490919e12357a.tar.gz
HIP: Remove ROMClang compiler id and use Clang directly
Since commit bd844387df (ROCMClang: Add the ROCm toolkit derived clang compiler to CMake, 2020-08-28, v3.21.0-rc1~66^2~6) and commit ff0d2858e1 (HIP: Extract clang compiler details from hipcc, 2020-10-21, v3.21.0-rc1~66^2~5), the separate `ROCMClang` compiler id for `hipcc` has caused a few problems: * The compiler id changed from behavior of CMake 3.20 and below, breaking projects that already built with `hipcc` treated as `Clang`. * The implementation of `target_compile_features` was incomplete for the `ROCMClang` identity. * Only `hipcc` was identified as `ROCMClang`, so after it is unwrapped to the underlying `clang++`, future runs of new CMake versions on an existing build tree would not repeat this. * Clang should be usable as a HIP compiler without the `hipcc` wrapper. Remove the `ROMClang` compiler identity, and revise HIP language support to work directly with a Clang compiler. Reject direct `hipcc` usage as a HIP compiler. For now it cannot be supported because it interferes with flags CMake needs to pass to Clang. Fixes: #22536, #22460, #22593
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake24
1 files changed, 0 insertions, 24 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 65e7236482..30b4aec90b 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -150,30 +150,6 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endif()
endif()
- # When invoked with HIPCC we need to extract the path to the underlying
- # clang compiler when possible. This fixes the following issues:
- # env variables can change how hipcc behaves
- # allows us to properly find the binutils bundled with hip
- if(CMAKE_${lang}_COMPILER_ID STREQUAL "ROCMClang"
- AND CMAKE_${lang}_COMPILER MATCHES ".*hipcc")
- get_filename_component(_hipcc_dir "${CMAKE_${lang}_COMPILER}" DIRECTORY)
- execute_process(
- COMMAND "${_hipcc_dir}/hipconfig"
- --hipclangpath
- OUTPUT_VARIABLE output
- RESULT_VARIABLE result
- )
- if(result EQUAL 0 AND EXISTS "${output}")
- if(lang STREQUAL "C")
- set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${output}/clang")
- set(CMAKE_${lang}_COMPILER "${output}/clang" PARENT_SCOPE)
- else()
- set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${output}/clang++")
- set(CMAKE_${lang}_COMPILER "${output}/clang++" PARENT_SCOPE)
- endif()
- endif()
- endif()
-
if (COMPILER_QNXNTO AND CMAKE_${lang}_COMPILER_ID STREQUAL "GNU")
execute_process(
COMMAND "${CMAKE_${lang}_COMPILER}"