]> granicus.if.org Git - clang/commitdiff
[CMake] Remove CLANG_APPEND_VC_REV option
authorChris Bieneman <beanz@apple.com>
Fri, 24 Jun 2016 20:21:12 +0000 (20:21 +0000)
committerChris Bieneman <beanz@apple.com>
Fri, 24 Jun 2016 20:21:12 +0000 (20:21 +0000)
I added this option in r257827 to try and add compatibility with autoconf. At the time I misunderstood the problem.

Our CMake automatically generates the SVN revision information and generates a build action to update it so builds don't need to be re-configured on SCM update (which is a better solution than we had in autoconf).

The problem I was actually seeing was isolated cases where SVN revision information isn't available because the repository structures have been removed. This happens in some automated testing systems.

This patch allows SVN_REVISION to be overridden if the build configuration could not find the SCM repository structures, and removes the code from my original patch because it is unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273714 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
lib/Basic/CMakeLists.txt

index 114d23095eefe03701a017b7b68723e8d41524a8..6a65608954c49b7f6dcf6eb9fc9771156a8e8b53 100644 (file)
@@ -214,19 +214,6 @@ 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(CLANG_APPEND_VC_REV)
-  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()
-endif()
-
 set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
   "Vendor-specific uti.")
 
index cfad8c3649eddd4b1a1081d148218a6f12f3395b..7524b8cd121fbf3e90c5a5f0516ba289105df343 100644 (file)
@@ -53,6 +53,13 @@ if(DEFINED llvm_vc AND DEFINED clang_vc)
 else()
   # Not producing a VC revision include.
   set(version_inc)
+
+  # Being able to force-set the SVN revision in cases where it isn't available
+  # is useful for performance tracking, and matches compatibility from autoconf.
+  if(SVN_REVISION)
+    set_source_files_properties(Version.cpp
+      PROPERTIES COMPILE_DEFINITIONS "SVN_REVISION=\"${SVN_REVISION}\"")
+  endif()
 endif()
 
 add_clang_library(clangBasic