[cfe-dev] [PATCH] Handle LLVM_APPEND_VC_REV with LLVM cmake module

Adam Strzelecki ono at java.pl
Tue May 13 10:16:56 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..7c0372a 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)
+  set(LLVM_REVISION ${SVN_REVISION})
+  set(LLVM_REPOSITORY ${SVN_REPOSITORY})
+  add_version_info_from_vcs(CLANG_REVISION ${CLANG_SOURCE_DIR})
+  message(STATUS "Clang revision: ${CLANG_REVISION}")
+  set(VERSION_DEFINITIONS
+    LLVM_REVISION=\"${LLVM_REVISION}\" LLVM_REPOSITORY=\"${LLVM_REPOSITORY}\"
+    SVN_REVISION=\"${SVN_REVISION}\" SVN_REPOSITORY=\"${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-dev mailing list