Skip to content

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

License

Notifications You must be signed in to change notification settings

maxint/arcbuild

Repository files navigation

ArcBuild

build status build status build status 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.

Dependencies

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

Usage

  1. Download arcbuild and arcbuild.cmake to <root of your project>.
  2. Generate build directory and build.
cmake -P arcbuild.cmake [(-D<var>=<value>)...] -S . -B build
cmake --build build --config <config> [--target <target>]

More arcbuild.cmake documents will be found in docs, and see CMake Build Tool Mode

Supported Platforms and Arguments Preview

OS PLATFORM ARCH More Arguments
Windows vs201{2,3,5,7,9} x86, x64, arm
Linux linux x86, x64
Android android arm{,v7-a,v8-a,64}, x86, x64 TOOLCHAIN, STL, API_VERSION
iOS ios [armv7;][armv7s;][arm64] IOS_BITCODE, API_VERSION
Raspberry Pi pi arm{,v7-a,v8-a}
Emscripten emscripten
Custom ARM linux arm{,v7-a,v8-a}, x86, x64
Qualcomm TEE qtee arm{v5,v6m,v7,v7m,64}

Building Examples

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

cmake -DPLATFORM=android -DROOT="E:\NDK\android-ndk-r11b" -P arcbuild.cmake
cmake -DPLATFORM=android -P arcbuild.cmake # use $ANDROID_NDK_ROOT

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=x64 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"

Build for Emscripten

cmake -P arcbuild.cmake -DPLATFORM=emscripten -DROOT=D:\emscripten\1.38.11 -DMAKE_PROGRAM=D:\gnu-tools\bin\make.exe

Custom cross compiling for Linux based platform

cmake -P arcbuild.cmake -DPLATFORM=linux -DARCH=arm -DROOT=~/arm-toolchain

For more arguments, please check Arguments for Platforms.

Example Projects

TODO

  • More tests.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages