Allow overriding the location of C/C++ compilers in Android CMake build.
[oota-llvm.git] / cmake / platforms / Android.cmake
index 72849b1..35df5eb 100644 (file)
 # 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")