13

https://github.com/ninja-build/ninja/releases

I have downloaded the ninja-win.zip folder and extracted it. When I open it, there is a single .exe file in the entire folder. When I double click it a cmd window flashes for a split second. I have also tried running it as administrator, but the same thing happens. What I don't understand is, what am I expected to do with this .exe file?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Senyokbalgul
  • 1,058
  • 4
  • 13
  • 37

3 Answers3

8

You must open a terminal (cmd.exe on Windows) and type something like ninja -f /path/to/buld/file. You may also wish to modify the PATH environment variable so that Windows knows where to find the Ninja executable, depending on your setup.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JeremiahB
  • 896
  • 8
  • 15
  • I am getting the error `'ninja-build' is not recognized as an internal or external command, operable program or batch file.` – Senyokbalgul Mar 10 '17 at 08:24
  • Sorry, with the prebuilt binaries the command is *ninja*, not *ninja-build*. I foolishly assumed it would be the same as the package on my linux distribution. Also, you must run this command in the same directory as the executable, or as mentioned add the directory you are keeping ninja in to your path. – JeremiahB Mar 10 '17 at 16:15
  • 1
    It seems now that this happens `ninja: error: loading 'C:\ninja\ninja_build': Access is denied.` when I did `ninja -f C:\ninja\ninja_build` – Senyokbalgul Mar 12 '17 at 04:19
  • /path/to/build/file should be the path to a *build.ninja* file, which describes how to compile a project. See the ninja documentation at https://ninja-build.org/manual.html for full instructions. – JeremiahB Mar 12 '17 at 15:10
7

You can simple download ninja.exe file from this Link

https://github.com/ninja-build/ninja/releases

After that you just have to add the path to your ninja.exe file to your windows environment variables and then you can use ninja commands from anywhere in windows.

Abdul ahad
  • 1,383
  • 7
  • 18
3

1. Open cmd in your Project Directory

2. There are guides on the internet on where to save the Ninja.exe so that it'll be callable in Cmd without specifying directory. Either follow them or:

i, Specify Directory when Calling Ninja. Putting "ninja" in Cmd actually calls Ninja.exe and is the same as something like "C:\users\user1\downloads\Ninja". or:

ii, Save Ninja.exe in the same directory as Project.

3. proceed with rest of the command.

Therefore the Final Command would be:

"C:\users\user\downloads\Ninja.exe" -f "D:\Projects\Project1"