summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-Clang.cmake
diff options
context:
space:
mode:
authorThomas Bernard <tbernard@go-engineering.de>2020-08-20 21:43:35 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-11 13:05:03 (GMT)
commitcf83758b24e3f27bcc2a1e4daba9ca58ac22fa9b (patch)
tree042aebd5995755b67517a61fea34b16e60f86728 /Modules/Platform/Windows-Clang.cmake
parent60b10d4fad26c0cd877d06ebcca9f5f583d1275d (diff)
downloadCMake-cf83758b24e3f27bcc2a1e4daba9ca58ac22fa9b.zip
CMake-cf83758b24e3f27bcc2a1e4daba9ca58ac22fa9b.tar.gz
CMake-cf83758b24e3f27bcc2a1e4daba9ca58ac22fa9b.tar.bz2
Clang: Implement CMAKE_${LANG}_COMPILER_TARGET for all variants on windows
Fixes: #21097
Diffstat (limited to 'Modules/Platform/Windows-Clang.cmake')
-rw-r--r--Modules/Platform/Windows-Clang.cmake15
1 files changed, 12 insertions, 3 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 0d74d30..2261c90 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -163,7 +163,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
include(Platform/Windows-MSVC)
# Set the clang option forwarding prefix for clang-cl usage in the llvm-rc processing stage
__enable_llvm_rc_preprocessing("-clang:")
- macro(__windows_compiler_clang lang)
+ macro(__windows_compiler_clang_base lang)
set(_COMPILE_${lang} "${_COMPILE_${lang}_MSVC}")
__windows_compiler_msvc(${lang})
endmacro()
@@ -179,7 +179,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
set(CMAKE_BUILD_TYPE_INIT Debug)
__enable_llvm_rc_preprocessing("")
- macro(__windows_compiler_clang lang)
+ macro(__windows_compiler_clang_base lang)
__windows_compiler_clang_gnu(${lang})
endmacro()
endif()
@@ -187,7 +187,16 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
else()
include(Platform/Windows-GNU)
__enable_llvm_rc_preprocessing("")
- macro(__windows_compiler_clang lang)
+ macro(__windows_compiler_clang_base lang)
__windows_compiler_gnu(${lang})
endmacro()
endif()
+
+macro(__windows_compiler_clang lang)
+ if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0)
+ set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "-target ")
+ else()
+ set(CMAKE_${lang}_COMPILE_OPTIONS_TARGET "--target=")
+ endif()
+ __windows_compiler_clang_base(${lang})
+endmacro()