[PATCH] D18159: [CMake] Add PACKAGE_VENDOR for customizing version output

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 14:26:41 PDT 2016


beanz created this revision.
beanz added reviewers: aprantl, bogner.
beanz added a subscriber: llvm-commits.

This change adds a PACKAGE_VENDOR variable. When set it makes the version output more closely resemble the clang version output.

http://reviews.llvm.org/D18159

Files:
  include/llvm/Config/config.h.cmake
  lib/Support/CommandLine.cpp

Index: lib/Support/CommandLine.cpp
===================================================================
--- lib/Support/CommandLine.cpp
+++ lib/Support/CommandLine.cpp
@@ -1756,8 +1756,12 @@
 public:
   void print() {
     raw_ostream &OS = outs();
-    OS << "LLVM (http://llvm.org/):\n"
-       << "  " << PACKAGE_NAME << " version " << PACKAGE_VERSION;
+#ifdef PACKAGE_VENDOR
+    OS << PACKAGE_VENDOR << " ";
+#else
+    OS << "LLVM (http://llvm.org/):\n  ";
+#endif
+    OS << PACKAGE_NAME << " version " << PACKAGE_VERSION;
 #ifdef LLVM_VERSION_INFO
     OS << " " << LLVM_VERSION_INFO;
 #endif
Index: include/llvm/Config/config.h.cmake
===================================================================
--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -540,6 +540,9 @@
 /* Define to the version of this package. */
 #cmakedefine PACKAGE_VERSION "${PACKAGE_VERSION}"
 
+/* Define to the vendor of this package. */
+#cmakedefine PACKAGE_VENDOR "${PACKAGE_VENDOR}"
+
 /* Define as the return type of signal handlers (`int' or `void'). */
 #cmakedefine RETSIGTYPE ${RETSIGTYPE}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18159.50649.patch
Type: text/x-patch
Size: 1115 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160314/47956046/attachment.bin>


More information about the llvm-commits mailing list