[PATCH] D35377: [CMAKE] PR33717 When LLVM_APPEND_VC_REV = OFF, only create VCSRevision.h if it doesn't already exist.

don hinton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 12:40:37 PDT 2017


hintonda created this revision.
Herald added a subscriber: mgorny.

If LLVM_APPEND_VC_REV = OFF, find_first_existing_vc_file will
not set llvm_vc and VCSRevision.h will be rewritten every time cmake
is run, which causes everything VCSRevision.h depends on to get
rebuilt and relinked even if nothing else changed.


https://reviews.llvm.org/D35377

Files:
  include/llvm/Support/CMakeLists.txt


Index: include/llvm/Support/CMakeLists.txt
===================================================================
--- include/llvm/Support/CMakeLists.txt
+++ include/llvm/Support/CMakeLists.txt
@@ -55,7 +55,9 @@
     PROPERTIES GENERATED TRUE
                HEADER_FILE_ONLY TRUE)
 else()
-  file(WRITE "${version_inc}" "")
+  if(NOT EXISTS "${version_inc}")
+    file(WRITE "${version_inc}" "")
+	endif()
 endif()
 
 add_custom_target(llvm_vcsrevision_h DEPENDS "${version_inc}")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35377.106490.patch
Type: text/x-patch
Size: 479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170713/0358c5f3/attachment-0001.bin>


More information about the llvm-commits mailing list