Skip to content

Commit 518f28d

Browse files
authored
Merge pull request llvm#8395 from apple/jdevlieghere/rdar/121526866
[llvm] Include LLVM_REPOSITORY and LLVM_REVISION in tool version (llvm#84
2 parents f00809c + d8a7634 commit 518f28d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

llvm/lib/Support/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ add_llvm_component_library(LLVMSupport
279279
${LLVM_MAIN_INCLUDE_DIR}/llvm/Support
280280
${Backtrace_INCLUDE_DIRS}
281281

282+
DEPENDS
283+
llvm_vcsrevision_h
284+
282285
LINK_LIBS
283286
${system_libs} ${imported_libs} ${delayload_flags}
284287

llvm/lib/Support/CommandLine.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "llvm/Support/Path.h"
4040
#include "llvm/Support/Process.h"
4141
#include "llvm/Support/StringSaver.h"
42+
#include "llvm/Support/VCSRevision.h"
4243
#include "llvm/Support/VirtualFileSystem.h"
4344
#include "llvm/Support/raw_ostream.h"
4445
#include <cstdlib>
@@ -2544,7 +2545,15 @@ class VersionPrinter {
25442545
#else
25452546
OS << "LLVM (http://llvm.org/):\n ";
25462547
#endif
2547-
OS << PACKAGE_NAME << " version " << PACKAGE_VERSION << "\n ";
2548+
OS << PACKAGE_NAME << " version " << PACKAGE_VERSION;
2549+
#ifdef LLVM_REPOSITORY
2550+
OS << " (" << LLVM_REPOSITORY;
2551+
#ifdef LLVM_REVISION
2552+
OS << ' ' << LLVM_REVISION;
2553+
#endif
2554+
OS << ')';
2555+
#endif
2556+
OS << "\n ";
25482557
#if LLVM_IS_DEBUG_BUILD
25492558
OS << "DEBUG build";
25502559
#else

0 commit comments

Comments
 (0)