Premake module to support Ninja, because it's awesome.
-
Put these files in a "premake-ninja" subdirectory of Premake search paths.
-
Adapt your premake5.lua script, or better: create/adapt your premake-system.lua
require "premake-ninja/ninja"
- Generate ninja files
premake5 ninja
On msys2 (mingw)
premake5 ninja --cc=gcc --shell=posix
- Run ninja
For each project - configuration pair, we create separate .ninja file. For solution we create build.ninja file which imports other .ninja files with subninja command.
Build.ninja file sets phony targets for configuration names so you can build them from command line. And default target is the first configuration name in your project (usually default).
General from:
ninja $(YourProjectName)_$(ConfigName)
as example:
ninja myapp_Release
Part of integration tests of several generators in https://github.com/Jarod42/premake-sample-projects