summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-12-10 10:04:38 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-12-10 10:04:38 +0000
commit78304a913130bb019e1b29debd8221839d9ea390 (patch)
tree4fee37d1c4ce983ba713884dfc60d0e7047163af
parent1f8bd3057eae206d779905ff49473b7e7c04d1a7 (diff)
downloadllvm-78304a913130bb019e1b29debd8221839d9ea390.tar.gz
llvm-78304a913130bb019e1b29debd8221839d9ea390.tar.bz2
llvm-78304a913130bb019e1b29debd8221839d9ea390.tar.xz
Teach the VCS detection to set some root-level variables with the raw
revision and git commit data extracted. This will be used in the Clang CMake build to avoid trying to re-detect the information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146324 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/modules/VersionFromVCS.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/modules/VersionFromVCS.cmake b/cmake/modules/VersionFromVCS.cmake
index 62bffb02e3..bf5776303d 100644
--- a/cmake/modules/VersionFromVCS.cmake
+++ b/cmake/modules/VersionFromVCS.cmake
@@ -13,6 +13,7 @@ function(add_version_info_from_vcs VERS)
if( Subversion_FOUND )
subversion_wc_info( ${CMAKE_CURRENT_SOURCE_DIR} Project )
if( Project_WC_REVISION )
+ set(SVN_REVISION ${Project_WC_REVISION} PARENT_SCOPE)
set(result "${result}-r${Project_WC_REVISION}")
endif()
endif()
@@ -30,6 +31,7 @@ function(add_version_info_from_vcs VERS)
if( git_result EQUAL 0 )
string(REGEX MATCH r[0-9]+ git_svn_rev ${git_output})
string(SUBSTRING "${git_svn_rev}" 1 -1 git_svn_rev_number)
+ set(SVN_REVISION ${git_svn_rev_number} PARENT_SCOPE)
set(git_svn_rev "-svn-${git_svn_rev}")
# Determine if the HEAD points directly at a subversion revision.
@@ -55,6 +57,7 @@ function(add_version_info_from_vcs VERS)
OUTPUT_VARIABLE git_output)
if( git_result EQUAL 0 AND NOT is_git_svn_rev_exact )
string(STRIP "${git_output}" git_ref_id)
+ set(GIT_COMMIT ${git_ref_id} PARENT_SCOPE)
set(result "${result}${git_svn_rev}-${git_ref_id}")
else()
set(result "${result}${git_svn_rev}")