I have a situation where a file may be provided by the user, or generated at run-time by ninja. I'm finding that the obvious way to represent this (by simply having a rule generating a file) doesn't work; the file is always regenerated, even if it doesn't exist.
-d explain says it's being rebuilt because:
ninja explain: command line not found in log for <filename>
I mean... that's true, but it's not helpful. Looking at the source code to ninja it seems that this happens if there's no command line log entry and the edge isn't tagged with generator=true. And indeed, setting generator=true makes ninja behave the way I'd expect.
But that's terrible. Is there a better way?
Thanks!