diff options
author | Brad King <brad.king@kitware.com> | 2018-10-08 15:09:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-08 15:09:08 (GMT) |
commit | d92737821f815b98f6bc29ff9a18928eddc0e903 (patch) | |
tree | c5b5109038a5834454e6e56a6e50f3f64410529d /Modules | |
parent | 3261e18f0379321e9bd77bfb48a320051f9de56f (diff) | |
parent | 66f49d1f9ae46d928df0509e96215cdd28db4dcb (diff) | |
download | CMake-d92737821f815b98f6bc29ff9a18928eddc0e903.zip CMake-d92737821f815b98f6bc29ff9a18928eddc0e903.tar.gz CMake-d92737821f815b98f6bc29ff9a18928eddc0e903.tar.bz2 |
Merge branch 'autogen-moc-predef-cross-compile' into release-3.13
Merge-request: !2452
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Compiler/Clang.cmake | 8 | ||||
-rw-r--r-- | Modules/Platform/Android-Clang.cmake | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 1653b55..e23470b 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -33,6 +33,14 @@ else() set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ") set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP) + if(CMAKE_${lang}_COMPILER_TARGET) + if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0) + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-target" "${CMAKE_${lang}_COMPILER_TARGET}") + else() + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}") + endif() + endif() + set(_CMAKE_${lang}_IPO_SUPPORTED_BY_CMAKE YES) set(_CMAKE_${lang}_IPO_MAY_BE_SUPPORTED_BY_COMPILER YES) diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake index f739ab1..9ed1e01 100644 --- a/Modules/Platform/Android-Clang.cmake +++ b/Modules/Platform/Android-Clang.cmake @@ -40,5 +40,6 @@ macro(__android_compiler_clang lang) endif() if(NOT CMAKE_${lang}_COMPILER_TARGET) set(CMAKE_${lang}_COMPILER_TARGET "${_ANDROID_ABI_CLANG_TARGET}") + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}") endif() endmacro() |