Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Nmake was fun, but it was very annoying to use. It suffered from multiple problems:
cl
lacks a way to output makefile dependency info.Because of all this, I want to switch to another system. This system needs to be:
So the first thing people will think of is "cmake". Thing is, we tried cmake, and it was miserable. CMake as a language is terrible, and CMake as a tool does a ton of stuff behind your back - it was hard to get it to invoke the compiler with exactly the flags we wanted - something we really need here. We need something both simpler and more flexible.
So my thoughts went to ninja. Ninja is a build tool that's supposed to be very fast, very dumb (in the good way), and very robust. We should be able to write a build.ninja file for our build that works well, right? Well, that does work if we only had a single build type. But ninja lacks the ability to do conditionals, complicating the ability to have both a diffbuild and a normal build. We may be able to work around this by creating different targets, but it's not entirely straightforward how that would work.
Instead, the way we're supposed to use ninja is by wrapping it in a generator, and ninja is kind enough to give us a very nice tool to make our own wrapper: ninja_syntax.py. So the plan is this: We create a new python script,
build.py
, which will automatically generate the appropriatebuild.ninja
, and run ninja on it.This works great! It does both cmdline tracking and header tracking, meaning when we switch from a normal build to a diffbuild, or when we edit a header, ninja will automatically know to recompile some of the files!