summaryrefslogtreecommitdiff
path: root/cmake/base-config-ix.cmake
diff options
context:
space:
mode:
authorSumanth Gundapaneni <sgundapa@codeaurora.org>2016-06-27 19:46:50 +0000
committerSumanth Gundapaneni <sgundapa@codeaurora.org>2016-06-27 19:46:50 +0000
commitc95a1eab58119bd2e3962e6d3b184eef723270c4 (patch)
tree4577724d3ff847534682d198919c2679f5cc889c /cmake/base-config-ix.cmake
parentd648ecb29ccd3ec70c14a8a812ea04626835f3e3 (diff)
Parse the triple in base-config-ix to propagate ANDROID variable correctly
The triple must be parsed in base-config-ix.cmake. Otherwise, the cmake variable ANDROID won't be set and this will confuse cmake to build unsupported targets targeted for android. Diferential revision: http://reviews.llvm.org/D21474 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@273914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/base-config-ix.cmake')
-rw-r--r--cmake/base-config-ix.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/base-config-ix.cmake b/cmake/base-config-ix.cmake
index 0829344df..a0e14e8dd 100644
--- a/cmake/base-config-ix.cmake
+++ b/cmake/base-config-ix.cmake
@@ -61,6 +61,19 @@ else()
set(COMPILER_RT_TEST_COMPILER_ID GNU)
endif()
+set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${TARGET_TRIPLE} CACHE STRING
+ "Default triple for which compiler-rt runtimes will be built.")
+if(DEFINED COMPILER_RT_TEST_TARGET_TRIPLE)
+ # Backwards compatibility: this variable used to be called
+ # COMPILER_RT_TEST_TARGET_TRIPLE.
+ set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${COMPILER_RT_TEST_TARGET_TRIPLE})
+endif()
+
+string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE})
+list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH)
+list(GET TARGET_TRIPLE_LIST 1 COMPILER_RT_DEFAULT_TARGET_OS)
+list(GET TARGET_TRIPLE_LIST 2 COMPILER_RT_DEFAULT_TARGET_ABI)
+
if ("${COMPILER_RT_DEFAULT_TARGET_ABI}" STREQUAL "androideabi")
set(ANDROID 1)
endif()