This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Generate LLDB_REVISION at build time
ClosedPublic

Authored by beanz on Sep 22 2016, 2:37 PM.

Details

Summary

This alters the generation of LLDB_REVISION to be heavily based on how clang generates its version header. There are two benefits of this aproach.

(1) The LLDB_REVISION is generated at build time, so it will be updated after an SCM pull/update even if CMake doesn't re-run
(2) This works on Windows

As noted this code is a simplified implementation of the code from clang.

Diff Detail

Event Timeline

beanz updated this revision to Diff 72215.Sep 22 2016, 2:37 PM
beanz retitled this revision from to [CMake] Generate LLDB_REVISION at build time.
beanz updated this object.
beanz added reviewers: tfiala, zturner.
beanz added a subscriber: lldb-commits.
zturner edited edge metadata.Sep 22 2016, 2:40 PM

Should this be sunk into a common llvm function instead of copying from clang? I don't have a strong opinion, but are you one of the main CMake maintainers in LLVM, so whatever you think is best.

beanz added a comment.Sep 22 2016, 4:36 PM

Putting this in LLVM would be ideal, but I think doing that requires a larger refactoring of how LLVM and Clang handle SCM versions. I was kinda hoping to land this and fix the lldb support, but if you'd prefer I can shelve this until after fixing LLVM & Clang.

tfiala accepted this revision.Sep 22 2016, 9:47 PM
tfiala edited edge metadata.

Looks good.

I think it's fine landing here for now based on your earlier comments about the refactoring effort to get it into LLVM/clang. I do think it's worth trying to sink it lower when the time is right to do more of that refactoring, though.

Thanks!

This revision is now accepted and ready to land.Sep 22 2016, 9:47 PM
zturner accepted this revision.Sep 23 2016, 4:30 PM
zturner edited edge metadata.

lgtm, everything works.

This revision was automatically updated to reflect the committed changes.