summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index ad2ac42c403..d8e98c43e0a 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -101,6 +101,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
include(AddLLVM)
include(TableGen)
include(HandleLLVMOptions)
+ include(VersionFromVCS)
set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
@@ -213,6 +214,18 @@ if(CLANG_REPOSITORY_STRING)
add_definitions(-DCLANG_REPOSITORY_STRING="${CLANG_REPOSITORY_STRING}")
endif()
+option(CLANG_APPEND_VC_REV
+ "Append the version control system revision id to clang version spew" OFF)
+
+if(NOT SVN_REVISION)
+ # This macro will set SVN_REVISION in the parent scope
+ add_version_info_from_vcs(VERSION_VAR)
+endif()
+
+if(SVN_REVISION)
+ add_definitions(-DSVN_REVISION="${SVN_REVISION}")
+endif()
+
set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
"Vendor-specific uti.")
OpenPOWER on IntegriCloud