premake-ninja
premake-ninja copied to clipboard
Add support for custom toolsets and enforce root-relative paths
Changes
Ninja expects all paths to be relative to the root ninja folder
(see: Issue 997 in ninja-build/ninja) Ninja expects paths to files to be relative to the root build file. Unfortunately, premake has no way of telling this to the toolsets, but we can work around this limitation by tricking them into generating paths relative to the workspace directory. See lines 255-262 and 273-280 for specifics.
RC files shouldn't be supported on targets other than windows
Since platforms like macos and linux don't integrate support for rc/res files, the "rc" rule shouldn't be generated. This removes the expectation that every toolset has a rc file command and allows support for custom toolsets, like emscripten, that don't support rc files.
Custom toolset support
Added simple support for custom toolset. Ninja will check for the function clang_like()
on toolsets and if it returns true, will generate compilation rules using the gcc/clang branch of the conditional in compilation_rules(...)
.
Associated Issues
Fixes #32