diff options
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Windows-Clang.cmake | 15 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 5 |
4 files changed, 14 insertions, 10 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 96f32e5..2f1b0a3 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -88,7 +88,7 @@ else() ) endif() if(CMAKE_C_COMPILER_TARGET) - list(PREPEND CMAKE_C_COMPILER_ID_TEST_FLAGS "-c --target=${CMAKE_C_COMPILER_TARGET}") + set(CMAKE_C_COMPILER_ID_TEST_FLAGS_FIRST "-c --target=${CMAKE_C_COMPILER_TARGET}") endif() # Build a small source file to identify the compiler. if(NOT CMAKE_C_COMPILER_ID_RUN) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 2205c8f..2b27476 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -84,7 +84,7 @@ else() endif() if(CMAKE_CXX_COMPILER_TARGET) - list(PREPEND CMAKE_CXX_COMPILER_ID_TEST_FLAGS "-c --target=${CMAKE_CXX_COMPILER_TARGET}") + set(CMAKE_CXX_COMPILER_ID_TEST_FLAGS_FIRST "-c --target=${CMAKE_CXX_COMPILER_TARGET}") endif() # Build a small source file to identify the compiler. 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() diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index de31dab..bd08718 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -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 |