I recently found zapcc: superfast clang-based C/C++ compiler and checked it with cocos2d-x and it works perfectly! Zapcc is
- 2-4x faster than clang on first build
- 20-50x faster than clang on cached build
It is quite impressive, isn’t it? There is guide how to use it with cmake build:
- Install it from binary package or source code: download from https://www.zapcc.com/ or get using git:
git clone https://github.com/yrnkrn/zapcc.git
- Run cmake with addicional arguments:
-DCMAKE_CXX_COMPILER=zapcc++ -DCMAKE_C_COMPILER=zapcc
P.S.: zapcc++
is symlink to zapcc
but act a bit different way (addictional linkage flags).
Enjoy fast builds!
UPD: you may notice huge memory usage. In this case:
- Find file named zapccs.config in directory, where all other zapcc binaries are installed.
- Change value in
[MaxMemory]
directive to something smaller (to co-cexist with other programs on 8GB ond four CPU cores I personally use512
). This value is in MBs.