[PATCH] D35533: [Basic] Update CMakeLists.txt to handle Repo

MinSeong Kim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 07:17:40 PDT 2017


minseong.kim added a comment.

Thanks for the reviewing this patch. Please correct if I am wrong.

The addition of "${path}/.git/HEAD" at line 37 is used only once when repo is initially synced "for the first time". This is because ${git_path}/logs/HEAD file at line 34 for Git or Git submodule does not exist with initial repo sync and therefore no generation of SVNVersion.inc  which is referenced by --version option, resulting null for the revision values of clang and llvm. After the second repo sync, the first file  "${git_path}/logs/HEAD" will be created and can be used to generate "SVNVersion.inc". This enables correct version information to be displayed even if new changes are merged.



================
Comment at: lib/Basic/CMakeLists.txt:17
 
 macro(find_first_existing_vc_file out_var path)
   set(git_path "${path}/.git")
----------------
hintonda wrote:
> LLVM already has a version of find_first_existing_vc_file in llvm/include/llvm/Support/CMakelists.txt.
> 
> Would it make sense move it to an llvm module and reuse it in clang?
Thanks for the suggestion. 
My understanding is that "llvm/include/llvm/Support/CMakeLists.txt" is used to generate VCSRevision.h which is used by llvm-specific modules such as opt, not clang. Furthermore find_first_existing_vc_file function in llvm/include/llvm/Support/CMakeLists.txt does not handle the version info either.


https://reviews.llvm.org/D35533





More information about the cfe-commits mailing list