<div dir="ltr">Please find a better fix here: <a href="https://github.com/ninja-build/ninja/pull/1580/commits/9221541695206b7e7e89f9b8743d8eae56634999">https://github.com/ninja-build/ninja/pull/1580/commits/9221541695206b7e7e89f9b8743d8eae56634999</a><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 24, 2019 at 11:36 AM Don Hinton <<a href="mailto:hintonda@gmail.com">hintonda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Just posted this fix on ninja's github page, but figured I'd share it with a larger audience.</div><div><br></div><div>Every time I run cmake && ninja in a new build directory, ninja will rerun cmake because the entry for build.ninja in .ninja_log is older than the timestamp on CMakeCache.txt, even if the timestamps on the actual file isn't older.</div><div><br></div>The following patch fixes the problem, i.e., there's no need to add build.ninja to the ninja_log:<div><br></div><div><pre style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:11.9px;margin-top:0px;background-color:rgb(246,248,250);border-radius:3px;line-height:1.45;overflow:auto;padding:16px;color:rgb(36,41,46);margin-bottom:0px"><code style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;background:transparent;border-radius:3px;margin:0px;padding:0px;border:0px;word-break:normal;display:inline;line-height:inherit;overflow:visible">diff --git a/src/ninja.cc b/src/ninja.cc
index a093cd1..810b22d 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -249,8 +249,6 @@ bool NinjaMain::RebuildManifest(const char* input_file, string* err) {
return false;
Builder builder(&state_, config_, &build_log_, &deps_log_, &disk_interface_);
- if (!builder.AddTarget(node, err))
- return false;
if (builder.AlreadyUpToDate())
return false; // Not an error, but we didn't rebuild.</code></pre></div><div><br></div><div>hth...</div><div>don</div></div>
</blockquote></div>