|
xuerui.fa The behavior you're seeing isn't directly related to MONGO_VERSION except that version_constants.h is generated from it, which actually part of the generated-sources target. The generated-sources target has no declared dependency on the value of MONGO_VERSION - nor can we easily make SCons aware of such a dependency, in fact, which means we also can't represent it in build.ninja, either.
What you're really asking for here is for Ninja to be aware of changes to the state of your worktree. Ninja is a tool that depends on a snapshot of the current state of the worktree in order to optimize the task. The only way we could make it aware of changes to the state of your worktree is to have it always run SCons to generate a new snapshot, which would be slow enough that it defeats the reason you probably wanted to use Ninja in the first place.
Unfortunately, this is just a limitation of Ninja. Whenever you change branches or do a git pull or do anything else that changes your worktree in a way that Ninja can't be aware of (anything operated on by the generated-sources target is a likely candidate), you will need to generate your build.ninja over again.
|