]> granicus.if.org Git - clang/commitdiff
[CMake] Properly respect the CLANG_APPEND_VC_REV option
authorChris Bieneman <beanz@apple.com>
Tue, 19 Jan 2016 17:06:12 +0000 (17:06 +0000)
committerChris Bieneman <beanz@apple.com>
Tue, 19 Jan 2016 17:06:12 +0000 (17:06 +0000)
Only set -DSVN_REVISION if CLANG_APPEND_VC_REV=On

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

CMakeLists.txt

index 54820170291119b15f34f31da5e8e5d02819b466..861fa964f22ff61dd12d1abb943c68c5f3977b4f 100644 (file)
@@ -216,14 +216,15 @@ 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(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}")
+  if(SVN_REVISION)
+    add_definitions(-DSVN_REVISION="${SVN_REVISION}")
+  endif()
 endif()
 
 set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING