Temporarily revert r151609, which enabled a new warning for LLVM and
[oota-llvm.git] / cmake / modules / VersionFromVCS.cmake
index a55e9b837f3870e69a7773459797af0cc339fc32..d6a2ae5f45f5eea20b9ba1ea710213f5ea14219f 100644 (file)
@@ -30,7 +30,9 @@ function(add_version_info_from_vcs VERS)
                       OUTPUT_VARIABLE git_output)
       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)
+        string(LENGTH "${git_svn_rev}" rev_length)
+        math(EXPR rev_length "${rev_length}-1")
+        string(SUBSTRING "${git_svn_rev}" 1 ${rev_length} git_svn_rev_number)
         set(SVN_REVISION ${git_svn_rev_number} PARENT_SCOPE)
         set(git_svn_rev "-svn-${git_svn_rev}")