summarylogtreecommitdiffstats
path: root/android-cmake.sh
blob: 550d12f6ed5fe72876237acc3d367bc5b936b87c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh

source android-env @TRIPLE@

PATH="${ANDROID_PREFIX_BIN}:$PATH" cmake \
    -DCMAKE_INSTALL_PREFIX="${ANDROID_PREFIX}" \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DINCLUDE_INSTALL_DIR="${ANDROID_PREFIX_INCLUDE}" \
    -DLIB_INSTALL_DIR="${ANDROID_PREFIX_LIB}" \
    -DSYSCONF_INSTALL_DIR="${ANDROID_PREFIX_ETC}" \
    -DSHARE_INSTALL_DIR="${ANDROID_PREFIX_SHARE}" \
    -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES="${ANDROID_PREFIX_INCLUDE}" \
    -DCMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES="${ANDROID_PREFIX_INCLUDE}" \
    -DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" \
    -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_BUILD_TYPE=Release \
    -DANDROID_ABI="${ANDROID_ABI}" \
    -DANDROID_NDK="${ANDROID_NDK_HOME}" \
    -DANDROID_NATIVE_API_LEVEL="${ANDROID_MINIMUM_PLATFORM}" \
    -DANDROID_TOOLCHAIN=clang \
    -DCMAKE_C_FLAGS="$CFLAGS" \
    -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
    -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \
    -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \
    "$@"