summaryrefslogtreecommitdiffstats
path: root/cmake/platforms
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-05-29 07:23:20 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-05-29 07:23:20 +0000
commitd86a66da78a0b81f9e2271417cd6204431467e73 (patch)
tree8b1e3f7deec425d2e01818084e2d10c51d11214d /cmake/platforms
parent530086925695f074b0e1e38a0d88ee6a4c91c54c (diff)
downloadexternal_llvm-d86a66da78a0b81f9e2271417cd6204431467e73.zip
external_llvm-d86a66da78a0b81f9e2271417cd6204431467e73.tar.gz
external_llvm-d86a66da78a0b81f9e2271417cd6204431467e73.tar.bz2
Allow overriding the location of C/C++ compilers in Android CMake build.
Patch by Greg Fitzgerald. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/platforms')
-rw-r--r--cmake/platforms/Android.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmake/platforms/Android.cmake b/cmake/platforms/Android.cmake
index 72849b1..35df5eb 100644
--- a/cmake/platforms/Android.cmake
+++ b/cmake/platforms/Android.cmake
@@ -11,8 +11,15 @@
# make <target>
SET(CMAKE_SYSTEM_NAME Linux)
-SET(CMAKE_C_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang)
-SET(CMAKE_CXX_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang++)
+
+IF(NOT CMAKE_C_COMPILER)
+ SET(CMAKE_C_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang)
+ENDIF()
+
+IF(NOT CMAKE_CXX_COMPILER)
+ SET(CMAKE_CXX_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang++)
+ENDIF()
+
SET(ANDROID "1" CACHE STRING "ANDROID" FORCE)
SET(ANDROID_COMMON_FLAGS "-target arm-linux-androideabi --sysroot=${LLVM_ANDROID_TOOLCHAIN_DIR}/sysroot -B${LLVM_ANDROID_TOOLCHAIN_DIR} -mllvm -arm-enable-ehabi")