llvm.org GIT mirror llvm / 468a95f
CMake toolchain file for Android NDK. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163612 91177308-0d34-0410-b5e6-96231b3b80d8 Evgeniy Stepanov 7 years ago
1 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 # Toolchain config for Android NDK.
1 # This is expected to be used with a standalone Android toolchain (see
2 # docs/STANDALONE-TOOLCHAIN.html in the NDK on how to get one).
3 #
4 # Usage:
5 # mkdir build; cd build
6 # cmake ..; make
7 # mkdir android; cd android
8 # cmake -DLLVM_ANDROID_TOOLCHAIN_DIR=/path/to/android/ndk \
9 # -DCMAKE_TOOLCHAIN_FILE=../../cmake/platforms/Android.cmake ../..
10 # make
11
12 SET(CMAKE_SYSTEM_NAME Linux)
13 SET(CMAKE_C_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang)
14 SET(CMAKE_CXX_COMPILER ${CMAKE_BINARY_DIR}/../bin/clang++)
15 SET(ANDROID "1" CACHE STRING "ANDROID" FORCE)
16
17 SET(ANDROID_COMMON_FLAGS "-target arm-linux-androideabi --sysroot=${LLVM_ANDROID_TOOLCHAIN_DIR}/sysroot -B${LLVM_ANDROID_TOOLCHAIN_DIR} -mllvm -arm-enable-ehabi")
18 SET(CMAKE_C_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_cflags" FORCE)
19 SET(CMAKE_CXX_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_cxxflags" FORCE)
20 SET(CMAKE_LINK_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_linkflags" FORCE)