[PATCH] D42676: Add support for LLVM_REPOSITORY_STRING.

Stephen Hines via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 19:14:38 PST 2018


srhines created this revision.
Herald added subscribers: cfe-commits, hintonda, mgorny.
srhines added a reviewer: beanz.

Without this, vendor Clang builds can occasionally pick up an arbitrary
mirror location for the repository (at least on Android builds). This
allows vendor builds to be more reproducible.


Repository:
  rC Clang

https://reviews.llvm.org/D42676

Files:
  CMakeLists.txt
  lib/Basic/Version.cpp


Index: lib/Basic/Version.cpp
===================================================================
--- lib/Basic/Version.cpp
+++ lib/Basic/Version.cpp
@@ -55,6 +55,9 @@
 }
 
 std::string getLLVMRepositoryPath() {
+#if defined(LLVM_REPOSITORY_STRING)
+  return LLVM_REPOSITORY_STRING;
+#else
 #ifdef LLVM_REPOSITORY
   StringRef URL(LLVM_REPOSITORY);
 #else
@@ -69,6 +72,7 @@
     URL = URL.substr(Start);
 
   return URL;
+#endif
 }
 
 std::string getClangRevision() {
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -267,6 +267,13 @@
   add_definitions(-DCLANG_REPOSITORY_STRING="${CLANG_REPOSITORY_STRING}")
 endif()
 
+set(LLVM_REPOSITORY_STRING "" CACHE STRING
+  "Vendor-specific text for showing the repository the LLVM source is taken from.")
+
+if(LLVM_REPOSITORY_STRING)
+  add_definitions(-DLLVM_REPOSITORY_STRING="${LLVM_REPOSITORY_STRING}")
+endif()
+
 set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
   "Vendor-specific uti.")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42676.131914.patch
Type: text/x-patch
Size: 1026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180130/98517ab5/attachment.bin>


More information about the cfe-commits mailing list