This is an archive of the discontinued LLVM Phabricator instance.

[CMAKE] Move version control macros to AddLLVM.cmake so they can be reused by clang, etc.
ClosedPublic

Authored by hintonda on Aug 21 2017, 10:00 AM.

Details

Summary

Move version control macros, find_first_existing_file and
find_first_existing_vc_file to AddLLVM.cmake so they can be reused by sub projects
like clang.

Please see D35533 for an example of where this would be useful.

Diff Detail

Repository
rL LLVM

Event Timeline

hintonda created this revision.Aug 21 2017, 10:00 AM
hintonda edited the summary of this revision. (Show Details)Aug 21 2017, 12:15 PM

LGTM

I just checked that this patch is working correctly from clang. I am just wondering if there is a possibility of using clang only without llvm. If this is the case, clang might need its own version control macros ? Or no such case.

hintonda edited the summary of this revision. (Show Details)Aug 26 2017, 8:06 AM

I just checked that this patch is working correctly from clang. I am just wondering if there is a possibility of using clang only without llvm. If this is the case, clang might need its own version control macros ? Or no such case.

LLVM is required to build clang, either in-tree or found via llvm-config for out-of-tree builds.

For in-tree builds, AddLLVM.cmake gets included by llvm/CMakeLists.txt, whereas it will be included by clang/CMakeLists.txt for out of tree builds.

hintonda retitled this revision from [CMAKE] Move version control macros to ADDLLVM so they can be reused by clang, etc. to [CMAKE] Move version control macros to AddLLVM.cmake so they can be reused by clang, etc..Aug 26 2017, 8:27 AM
minseong.kim accepted this revision.Aug 27 2017, 10:37 PM

I have tested this patch with git, git-svn, svn and repo. It is working as expected with clang's lib/Basic/CMakeLists.txt.
LGTM.

This revision is now accepted and ready to land.Aug 27 2017, 10:37 PM
This revision was automatically updated to reflect the committed changes.