Clang: Implement CMAKE_${LANG}_COMPILER_TARGET for all variants on windows

Fixes: #21097
This commit is contained in:
Thomas Bernard
2020-08-20 23:43:35 +02:00
committed by Brad King
parent 60b10d4fad
commit cf83758b24
4 changed files with 14 additions and 10 deletions
+12 -3
View File
@@ -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()
-5
View File
@@ -364,11 +364,6 @@ macro(__windows_compiler_msvc lang)
set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES)
set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES)
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()
# '-flto=thin' available since Clang 3.9 and Xcode 8
# * http://clang.llvm.org/docs/ThinLTO.html#clang-llvm
# * https://trac.macports.org/wiki/XcodeVersionInfo