diff options
author | Jordan Rose <jordan_rose@apple.com> | 2014-11-20 03:57:45 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2014-11-20 03:57:45 +0000 |
commit | 8dbfd1c79bf05f57ddf8765c97c26d05f3574b49 (patch) | |
tree | 151559a008b6fc8b9fab79345e285ea826b66000 /lib/Basic/CMakeLists.txt | |
parent | 0035283acf0f33d8b17b70b17a55df858073e422 (diff) |
[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!)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/CMakeLists.txt')
-rw-r--r-- | lib/Basic/CMakeLists.txt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Basic/CMakeLists.txt b/lib/Basic/CMakeLists.txt index 62748a08e5..a7bd8dec36 100644 --- a/lib/Basic/CMakeLists.txt +++ b/lib/Basic/CMakeLists.txt @@ -14,12 +14,16 @@ function(find_first_existing_file out_var) 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. |