Files
CMake/Modules/Platform/Windows-Clang-HIP.cmake
Gergely Meszaros 5b87ae6e2d HIP, Windows: Add Windows-Clang-HIP platform module
Add a platform module for using clang for HIP on windows, based on the
CXX module.

HIP language on windows works without this, but mixing with MSVC
produces catastrofical results.
Add the same restriction with HIP as C and C++ had prior:
Either none are compiled with MSVC or all are.

clang-cl support for HIP does not work yet: it needs more work in both
hip-lang-config.cmake and cmake itself.
2022-10-09 20:03:28 +02:00

20 lines
759 B
CMake

include(Platform/Windows-Clang)
set(_COMPILE_HIP_MSVC " -TP")
__windows_compiler_clang(HIP)
if("x${CMAKE_HIP_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
AND CMAKE_DEPFILE_FLAGS_HIP)
set(CMAKE_HIP_DEPENDS_USE_COMPILER TRUE)
endif()
elseif("x${CMAKE_HIP_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
AND CMAKE_DEPFILE_FLAGS_HIP)
# dependencies are computed by the compiler itself
set(CMAKE_HIP_DEPFILE_FORMAT gcc)
set(CMAKE_HIP_DEPENDS_USE_COMPILER TRUE)
endif()
endif()