Tutorial How to increase NDK compiling speed

AndnixSH

PMT Elite Modder
Original poster
Staff member
Modding-Team
Jun 27, 2017
4,534
302,348
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 %*
1639169755328.png


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