summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-08 15:09:08 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-08 15:09:08 (GMT)
commitd92737821f815b98f6bc29ff9a18928eddc0e903 (patch)
treec5b5109038a5834454e6e56a6e50f3f64410529d /Modules
parent3261e18f0379321e9bd77bfb48a320051f9de56f (diff)
parent66f49d1f9ae46d928df0509e96215cdd28db4dcb (diff)
downloadCMake-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.cmake8
-rw-r--r--Modules/Platform/Android-Clang.cmake1
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()