Page MenuHomePhabricator

Add experimental support for unofficial monorepo-like directory layout
ClosedPublic

Authored by mehdi_amini on Nov 7 2016, 12:18 PM.

Details

Summary

This allows to have clang and llvm and the other subprojects
side-by-side instead of nested. This can be used with the monorepo or
multiple repos.

It will help having a single set of sources checked out but allows to
have a build directory with llvm and another one with llvm+clang.
Basically it abstracts LLVM_EXTERNAL_xxxx_SOURCE_DIR making it more
convenient by adopting a convention.

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini retitled this revision from to Add experimental support for unofficial monorepo-like directory layout.
mehdi_amini updated this object.
mehdi_amini added reviewers: bogner, beanz, jlebar.
mehdi_amini added a subscriber: llvm-commits.

Document the new cmake flag

Update the comment in CMake

mehdi_amini updated this revision to Diff 77100.Nov 7 2016, 2:12 PM

Add a comment on the magic for clang-tools-extra

This revision was automatically updated to reflect the committed changes.
beanz edited edge metadata.Nov 7 2016, 4:49 PM

We should abstract this into a module that can be re-used and not have it implemented directly in the LLVM top-level CMakeLists. As an example other projects could use this code for out-of-tree builds to identify source directories for projects.

We should abstract this into a module that can be re-used and not have it implemented directly in the LLVM top-level CMakeLists. As an example other projects could use this code for out-of-tree builds to identify source directories for projects.

I can try!

Can you elaborate a little about the "other projects" case? You mean out-of-tree projects like Swift or in-tree projects like compiler-rt (or both)?

beanz added a comment.Nov 7 2016, 7:44 PM

As an example libcxx has goop to find libcxxabi and libunwind's source directories. This code could be in a module so that those projects could use a common module instead of hand-rolling the code.

As an example libcxx has goop to find libcxxabi and libunwind's source directories. This code could be in a module so that those projects could use a common module instead of hand-rolling the code.

OK, makes sense, I will work on this.