summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-MSVC.cmake
diff options
context:
space:
mode:
authorThomas Bernard <tbernard@go-engineering.de>2020-07-28 17:48:47 (GMT)
committerThomas Bernard <tbernard@go-engineering.de>2020-07-28 17:48:47 (GMT)
commit270e0d9c4d47821b884b87b4f69129d7f2b80677 (patch)
tree08f100774701c9a523292aa16606e6dfbbe5da0b /Modules/Platform/Windows-MSVC.cmake
parente4e899056eca97e62d40d47bf4ee2a4871553751 (diff)
downloadCMake-270e0d9c4d47821b884b87b4f69129d7f2b80677.zip
CMake-270e0d9c4d47821b884b87b4f69129d7f2b80677.tar.gz
CMake-270e0d9c4d47821b884b87b4f69129d7f2b80677.tar.bz2
Detect the correct target architecture for clang compilers.
During compiler identification, if CMAKE_{C,CXX}_COMPILER_TARGET is defined, the corresponding clang target flag is used to guaranty proper target architecture detection.
Diffstat (limited to 'Modules/Platform/Windows-MSVC.cmake')
-rw-r--r--Modules/Platform/Windows-MSVC.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 2476a33..e272da9 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -356,6 +356,11 @@ 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