summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android-Clang.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-05 14:21:40 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-05 14:23:52 (GMT)
commit66f49d1f9ae46d928df0509e96215cdd28db4dcb (patch)
tree382d14c5fb9bb129004018bd8dcb557d2c4f2899 /Modules/Platform/Android-Clang.cmake
parent39534c58c5d3b525c53f4be572e1b72b53eac220 (diff)
downloadCMake-66f49d1f9ae46d928df0509e96215cdd28db4dcb.zip
CMake-66f49d1f9ae46d928df0509e96215cdd28db4dcb.tar.gz
CMake-66f49d1f9ae46d928df0509e96215cdd28db4dcb.tar.bz2
Android: Add clang --target= flag to compiler predefines command
When we set `CMAKE_<LANG>_COMPILER_TARGET` to the Android target architecture, add it to `CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND` also. This is needed to make moc predefines aware of `__ANDROID__`. Fixes: #18425
Diffstat (limited to 'Modules/Platform/Android-Clang.cmake')
-rw-r--r--Modules/Platform/Android-Clang.cmake1
1 files changed, 1 insertions, 0 deletions
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()