1. Create separate toolchain for architecture

$NDK_DIR/build/tools/make_standalone_toolchain.py --arch arm64 --api 22 --install-dir ~/arm64-toolchain

2. Add separate toolchain to path

export PATH=~/arm-toolchain/bin:~/arm-toolchain/arm-linux-androideabi/bin:$PATH

3. Run distccd daemon on each compiling node

distccd --no-detach --daemon --allow 192.168.0.0/16 --allow 127.0.0.1 --log-stderr -p [port number]

4. Put compiling nodes addresses to ~/.distcc/hosts
5. Set env variables(if you have more than 1 abi)

DISTCC_DIR=/Users/james/distccconf/ + currentABI
CCACHE_PREFIX=/usr/local/bin/distcc

6. Add distcc to each C/C++ compiler call

externalNativeBuild {
   cmake {
       .....
       arguments "-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/distcc", "-DCMAKE_C_COMPILER_LAUNCHER=/usr/bin/distcc"
    }
}

7. Run build and enjoy!

Изменить пасту