Index: cmake/caches/Android-stage2.cmake =================================================================== --- /dev/null +++ cmake/caches/Android-stage2.cmake @@ -0,0 +1,21 @@ +set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "") + +set(CLANG_VENDOR Android CACHE STRING "") +set(CMAKE_BUILT_TYPE RELEASE CACHE STRING "") +set(LLVM_ENABLE_THREADS OFF CACHE BOOL "") +set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") + +set(LLVM_RUNTIME_TARGETS "i686-linux-android;x86_64-linux-android;aarch64-linux-android;armv7-linux-android" CACHE STRING "") + +foreach(target i686;x86_64;aarch64;armv7) + set(RUNTIMES_${target}-linux-android_ANDROID 1 CACHE STRING "") + set(RUNTIMES_${target}-linux-android_CMAKE_ASM_FLAGS ${Android_${target}_C_FLAGS} CACHE PATH "") + set(RUNTIMES_${target}-linux-android_CMAKE_C_FLAGS ${Android_${target}_C_FLAGS} CACHE PATH "") + set(RUNTIMES_${target}-linux-android_CMAKE_CXX_FLAGS ${Android_${target}_CXX_FLAGS} CACHE PATH "") + set(RUNTIMES_${target}-linux-android_CMAKE_SYSROOT ${Android_${target}_SYSROOT} CACHE PATH "") + set(RUNTIMES_${target}-linux-android_COMPILER_RT_ENABLE_WERROR ON CACHE BOOL "") + set(RUNTIMES_${target}-linux-android_COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "") + set(RUNTIMES_${target}-linux-android_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") + set(RUNTIMES_${target}-linux-android_LLVM_ENABLE_THREADS OFF CACHE BOOL "") + set(RUNTIMES_${target}-linux-android_LLVM_INCLUDE_TESTS OFF CACHE BOOL "") +endforeach() Index: cmake/caches/Android.cmake =================================================================== --- /dev/null +++ cmake/caches/Android.cmake @@ -0,0 +1,31 @@ +# This file sets up a CMakeCache for an Android toolchain build. + +set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "") + +set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "") +set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "") +set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "") +set(LLVM_BUILD_TOOLS OFF CACHE BOOL "") +set(LLVM_BUILD_RUNTIME OFF CACHE BOOL "") +set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") +set(LLVM_ENABLE_THREADS OFF CACHE BOOL "") +set(LLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD OFF CACHE BOOL "") +set(LLVM_TOOL_OPENMP_BUILD OFF CACHE BOOL "") + +set(CLANG_VENDOR Android CACHE STRING "") + +foreach(target i686;x86_64;aarch64;armv7) + if (Android_${target}_C_FLAGS) + list(APPEND EXTRA_ARGS -DAndroid_${target}_C_FLAGS=${Android_${target}_C_FLAGS}) + endif() + if (Android_${target}_SYSROOT) + list(APPEND EXTRA_ARGS -DAndroid_${target}_SYSROOT=${Android_${target}_SYSROOT}) + endif() + if (Android_${target}_CXX_FLAGS) + list(APPEND EXTRA_ARGS -DAndroid_${target}_CXX_FLAGS=${Android_${target}_CXX_FLAGS}) + endif() +endforeach() + + +set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") +set(CLANG_BOOTSTRAP_CMAKE_ARGS "${EXTRA_ARGS} -C${CMAKE_CURRENT_LIST_DIR}/Android-stage2.cmake" CACHE STRING "")