This is the AMP version of this page.
If you want to load the real page instead, click this text.

Tutorial How to increase NDK compiling speed

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,557
305,251
1,213
Modding World
I have found a way to increase compiling speed of Android NDK. This will work with any versions and any platforms

Since NDK is using make, we can simply add a -j(Number) flag. Go to the (SDK Location)\ndk\(NDK version)\build and edit the ndk-build.cmd (Windows) or ndk-build.sh (Linux/macOS) with any text editor of your choice. In this case, i'm using Windows

add the -j(Number) switch beside the path to make executeable. If you are unsure what number, just put 2. I recommended to use a half number of your CPU core like, if you have 8 cores of CPU, use 4. If your CPU usage is too high, reduce the number

Code:
"%PREBUILT_PATH%\bin\make.exe" -j4 -O -f "%NDK_ROOT%\build\core\build-local.mk" SHELL=cmd %*


That's pretty much all, enjoy compiling in parallel!