ArcBuild
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
- Download
arcbuild
andarcbuild.cmake
to<root of your project>/cmake
. - Build your project by runing
cmake -P cmake/arcbuild.cmake
. - More documents will be found in docs.
mkdir build
cd build
cmake -P arcbuild.cmake [(-D<var>=<value>)...] [<path-to-source>]
make
Building Examples
ARCH=armv7-a
by default)
Build for Android (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
ARCH=x86
by default)
Build for MSVC (cmake -P arcbuild.cmake -DPLATFORM=vs2013
cmake -P arcbuild.cmake -DPLATFORM=vs2015
cmake -P arcbuild.cmake -DPLATFORM=vs2017
ARCH=x86
by default)
Build for Linux (cmake -P arcbuild.cmake -DPLATFORM=linux
ARCH="armv7;armv7s;arm64;arm64e"
by default)
Build for iOS (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
- hello_world: "Hello world" project.
- combine_modules: Simple SDK with multiple dependencies.
TODO
- More tests.
- Set compile flags to individual source files.