/arcbuild

Easy cmake native and cross compiling for Android, iOS, Windows, Linux, etc.

Primary LanguageCMakeMIT LicenseMIT

ArcBuild

build status

Easy native and cross compiling for CMake projects.

Features

  • Pure CMake scripts and no other dependencies.
  • Support major platforms and system architectres, e.g. windows, linux, android, ios, tizen, etc.
  • [BETA] Support to combine multiple modules into one library automatically. It's useful when building static library for SDK delivery (check detail).

Dependencies

  • CMake >= 3.4 (3.8 or above is recommended)

Usage

  1. Download arcbuild and arcbuild.cmake to <root of your project>/cmake.
  2. Build your project by runing cmake -P cmake/arcbuild.cmake.
  3. More documents will be found in docs.
mkdir build
cd build
cmake -P arcbuild.cmake [(-D<var>=<value>)...] [<path-to-source>]
make

Building Examples

Build for Android (ARCH=armv7-a by default)

cmake -DPLATFORM=android -DROOT="E:\NDK\android-ndk-r11b" -P arcbuild.cmake
# or read ROOT from ANDROID_NDK_ROOT enviroment variable
cmake -DPLATFORM=android -P arcbuild.cmake

Build for MSVC (ARCH=x86 by default)

cmake -P arcbuild.cmake -DPLATFORM=vs2013
cmake -P arcbuild.cmake -DPLATFORM=vs2015
cmake -P arcbuild.cmake -DPLATFORM=vs2017

Build for Linux (ARCH=x86 by default)

cmake -P arcbuild.cmake -DPLATFORM=linux

Build for iOS (ARCH="armv7;armv7s;arm64;arm64e" by default)

cmake -P arcbuild.cmake -DPLATFORM=ios -DIOS_BITCODE=ON
cmake -P arcbuild.cmake -DPLATFORM=ios -DARCH="i386;x86_64"

Custom cross compiling for Linux based platform

cmake -P arcbuild.cmake -DPLATFORM=linux -DARCH=arm -DTOOLCHAIN_FILE=gcc-toolchain.cmake -DROOT=~/xxx/prebuilt/toolschain/usr

For more arguments, please check Arguments for Platforms.

Example Projects

TODO

  • More tests.
  • Set compile flags to individual source files.