summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-08 15:10:12 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-10-08 15:10:19 (GMT)
commit20e14baae79b5fd1f75aecbb167a3642f2c532d8 (patch)
tree6c67fc025edf2f45a812d99d0e8f75ea2642a83a /Modules
parente3666e8ffeeda24dcee69a27942678927e895fbc (diff)
parent66f49d1f9ae46d928df0509e96215cdd28db4dcb (diff)
downloadCMake-20e14baae79b5fd1f75aecbb167a3642f2c532d8.zip
CMake-20e14baae79b5fd1f75aecbb167a3642f2c532d8.tar.gz
CMake-20e14baae79b5fd1f75aecbb167a3642f2c532d8.tar.bz2
Merge topic 'autogen-moc-predef-cross-compile'
66f49d1f9a Android: Add clang --target= flag to compiler predefines command 39534c58c5 Autogen: Add clang --target= flag to compiler predefines command Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: André Klitzing <aklitzing@gmail.com> 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()