<div dir="ltr">I'm OK if this already does the right thing - but would like to know that, if you could check :) Otherwise, yeah, adding the empty-test would be good, I would think.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 13, 2017 at 1:03 PM don hinton <<a href="mailto:hintonda@gmail.com">hintonda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think so, but we could also check to see if it's empty.  That way you'll always have an empty file if it's OFF.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 13, 2017 at 12:51 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Does this do the correct/desired thing if LLVM_APPEND_VC_REV is changed from ON to OFF - or does it leave the last rev in the file indefinitely? That could eb confusing to developers.<div><div class="m_-3458694146649302573h5"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 13, 2017 at 12:40 PM don hinton via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hintonda created this revision.<br>
Herald added a subscriber: mgorny.<br>
<br>
If LLVM_APPEND_VC_REV = OFF, find_first_existing_vc_file will<br>
not set llvm_vc and VCSRevision.h will be rewritten every time cmake<br>
is run, which causes everything VCSRevision.h depends on to get<br>
rebuilt and relinked even if nothing else changed.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D35377" rel="noreferrer" target="_blank">https://reviews.llvm.org/D35377</a><br>
<br>
Files:<br>
  include/llvm/Support/CMakeLists.txt<br>
<br>
<br>
Index: include/llvm/Support/CMakeLists.txt<br>
===================================================================<br>
--- include/llvm/Support/CMakeLists.txt<br>
+++ include/llvm/Support/CMakeLists.txt<br>
@@ -55,7 +55,9 @@<br>
     PROPERTIES GENERATED TRUE<br>
                HEADER_FILE_ONLY TRUE)<br>
 else()<br>
-  file(WRITE "${version_inc}" "")<br>
+  if(NOT EXISTS "${version_inc}")<br>
+    file(WRITE "${version_inc}" "")<br>
+       endif()<br>
 endif()<br>
<br>
 add_custom_target(llvm_vcsrevision_h DEPENDS "${version_inc}")<br>
<br>
<br>
</blockquote></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div>