Guide to Downloading the Latest Version of Ninja and Removing Windows Path Limit

Guide to Downloading the Latest Version of Ninja and Removing Windows Path Limit

Guide to Downloading the Latest Version of Ninja and Removing Windows Path Limit

Ninja is a powerful tool that enables fast compilation of C++ projects. In this guide, we explain step by step how to update and configure Ninja.

1. Download the Latest Version of Ninja

Download the most recent version of Ninja here.

2. Update the Existing Ninja Version

Replace the old version by copying the new ninja.exe file you downloaded to the directory below:

$SDK_PATH$\cmake\$CMAKE_VERSION$\bin

3. Update Your build.gradle File

In your Android project, open the android/app/build.gradle file and add the following code:

externalNativeBuild { cmake { arguments "-DCMAKE_MAKE_PROGRAM=$YOUR_CMAKE_NINJA_PATH$", "-DCMAKE_OBJECT_PATH_MAX=1024" } }

Note: Replace the value of $YOUR_CMAKE_NINJA_PATH$ with the actual path where Ninja is installed. For example: E:\SDK\cmake\3.22.2\bin\ninja.exe

4. Enable Long Path Support in Windows

To support long file paths in Windows, run the following PowerShell command:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

This command allows Windows to support paths longer than 260 characters.

Conclusion

By following these steps, you can install the latest version of Ninja, use it in your project, and enable long file paths in Windows.

If you found this guide useful, don’t forget to leave a comment!