[PATCH] Handle LLVM_APPEND_VC_REV with LLVM cmake module

Adam Strzelecki ono at java.pl
Wed May 28 03:18:08 PDT 2014


LLVM uses own CMake module VersionFromVCS.cmake to lookup repository and
revision when LLVM_APPEND_VC_REV is ON, and it supports additionally getting
information from Git SVN and Git mirrors.
---
 lib/Basic/CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt
index 0df82b3..e42dc93 100644
--- a/lib/Basic/CMakeLists.txt
+++ b/lib/Basic/CMakeLists.txt
@@ -52,4 +52,14 @@ if (Subversion_FOUND AND EXISTS "${CLANG_SOURCE_DIR}/.svn")
   set_source_files_properties(Version.cpp
     PROPERTIES COMPILE_DEFINITIONS "HAVE_SVN_VERSION_INC")
 
+elseif (LLVM_APPEND_VC_REV)
+  add_version_info_from_vcs(CLANG_PACKAGE ${CLANG_SOURCE_DIR})
+  message(STATUS "Clang revision: ${CLANG_PACKAGE_SVN_REVISION}")
+  set(VERSION_DEFINITIONS
+    LLVM_REVISION=\"${PACKAGE_SVN_REVISION}\"
+    LLVM_REPOSITORY=\"${PACKAGE_SVN_REPOSITORY}\"
+    SVN_REVISION=\"${CLANG_PACKAGE_SVN_REVISION}\"
+    SVN_REPOSITORY=\"${CLANG_PACKAGE_SVN_REPOSITORY}\")
+  set_source_files_properties(Version.cpp
+    PROPERTIES COMPILE_DEFINITIONS "${VERSION_DEFINITIONS}")
 endif()
-- 
1.8.5.2 (Apple Git-48)




More information about the cfe-commits mailing list