New cmake option LLVM_APPEND_VC_REV for controlling when the VC
authorOscar Fuentes <ofv@wanadoo.es>
Mon, 20 Dec 2010 09:47:13 +0000 (09:47 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Mon, 20 Dec 2010 09:47:13 +0000 (09:47 +0000)
revision id is appended to the LLVM version string. Defaults to
OFF.

Until now the VC revision id was always appended to the revision
string whenever cmake was invoked (either explicitly or implicitly
because a cmake source file changed). This was causing massive
recompilations because config.h are reconfigured with the new contents
of PACKAGE_VERSION.

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

CMakeLists.txt
docs/CMake.html

index df2f8d5d512b601f98f112ba69a54c652dc804e8..3f48b58f43852093584243e60b1d94862ddb5c0d 100644 (file)
@@ -11,8 +11,15 @@ set(CMAKE_MODULE_PATH
   )
 
 set(PACKAGE_VERSION "2.9")
+
 include(VersionFromVCS)
-add_version_info_from_vcs(PACKAGE_VERSION)
+
+option(LLVM_APPEND_VC_REV
+  "Append the version control system revision id to LLVM version" OFF)
+
+if( LLVM_APPEND_VC_REV )
+  add_version_info_from_vcs(PACKAGE_VERSION)
+endif()
 
 set(PACKAGE_NAME llvm)
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
index c5c553826496d5e270815466737487aac2ee6545..0bafedd9b0930254569a67348b90efe9fde7885c 100644 (file)
     ON. You can use that option for disabling the generation of build
     targets for the LLVM unit tests.</dd>
 
+  <dt><b>LLVM_APPEND_VC_REV</b>:BOOL</dt>
+  <dd>Append version control revision info (svn revision number or git
+    revision id) to LLVM version string (stored in the PACKAGE_VERSION
+    macro). For this to work cmake must be invoked before the
+    build. Defaults to OFF.</dd>
+
   <dt><b>LLVM_ENABLE_THREADS</b>:BOOL</dt>
   <dd>Build with threads support, if available. Defaults to ON.</dd>