r222407 - [CMake] Use .svn/wc.db as our VC dependency if it's available.
Jordan Rose
jordan_rose at apple.com
Wed Nov 19 19:57:45 PST 2014
Author: jrose
Date: Wed Nov 19 21:57:45 2014
New Revision: 222407
URL: http://llvm.org/viewvc/llvm-project?rev=222407&view=rev
Log:
[CMake] Use .svn/wc.db as our VC dependency if it's available.
In order to keep SVNVersion.inc from being regenerated on every build, we need
to specify as a dependency a file that only changes when the VC state updates.
I previously just had .svn/entries, but that's only used by Subversion 1.6.
1.7 uses .svn/wc.db instead; prefer that if it's present.
(Thanks, Nico!)
Modified:
cfe/trunk/lib/Basic/CMakeLists.txt
Modified: cfe/trunk/lib/Basic/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/CMakeLists.txt?rev=222407&r1=222406&r2=222407&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/CMakeLists.txt (original)
+++ cfe/trunk/lib/Basic/CMakeLists.txt Wed Nov 19 21:57:45 2014
@@ -14,12 +14,16 @@ function(find_first_existing_file out_va
endforeach()
endfunction()
-find_first_existing_file(llvm_vc
- "${LLVM_MAIN_SRC_DIR}/.git/logs/HEAD"
- "${LLVM_MAIN_SRC_DIR}/.svn/entries")
-find_first_existing_file(clang_vc
- "${CLANG_SOURCE_DIR}/.git/logs/HEAD"
- "${CLANG_SOURCE_DIR}/.svn/entries")
+macro(find_first_existing_vc_file out_var path)
+ find_first_existing_file(${out_var}
+ "${path}/.git/logs/HEAD" # Git
+ "${path}/.svn/wc.db" # SVN 1.7
+ "${path}/.svn/entries" # SVN 1.6
+ )
+endmacro()
+
+find_first_existing_vc_file(llvm_vc "${LLVM_MAIN_SRC_DIR}")
+find_first_existing_vc_file(clang_vc "${CLANG_SOURCE_DIR}")
if(DEFINED llvm_vc AND DEFINED clang_vc)
# Create custom target to generate the VC revision include.
More information about the cfe-commits
mailing list