Skip to content

Building for Android

Johan Sköld edited this page Jul 24, 2016 · 2 revisions

To build for android, Andrey Kamaev's toolchain file is included in this repository for convenience. You will need to know where the Android NDK is located on your hard drive, as well as what API level to compile for. The general steps to compile are:

mkdir build-android
cd build-android
cmake -D CMAKE_TOOLCHAIN_FILE=../3rdparty/android-cmake/android.toolchain.cmake \
      -D CMAKE_BUILD_TYPE=<configuration> \
      -D ANDROID_NDK=<ndk path> \
      -D ANDROID_NATIVE_API_LEVEL=<api level> \
      -D ANDROID_ABI=<abi>
      ..
make

In the cmake command above, replace...

  • ... <configuration> with the configuration to build for. Android only supports Debug and Release.
  • ... <ndk path> with the path to the Android NDK. It's the folder that contains the platforms and toolchains folders. If not defined, it will be searched for.
  • ... <api level> with the API level to compile for.
  • ... <abi> with the ABI to compile for.

See android-cmake's README for complete options and their possible values.

Clone this wiki locally