[PATCH] D37637: [CMake] Determine early on which projects are enabled

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 8 12:01:36 PDT 2017


zturner created this revision.
Herald added a subscriber: mgorny.

Some projects need to add conditional dependencies on other projects.  compiler-rt is already doing this, and I attempted to add this to debuginfo-tests when I ran into the ordering problem, that you can't conditionally add a dependency unless that dependency's CMakeLists.txt has already been run (which would allow you to say `if (TARGET foo)`.

The solution to this seems to be to determine very early on the entire set of projects which is enabled.  This is complicated by the fact that there are multiple ways to enable projects, and different tree layouts (e.g. mono-repo, out of -tree, external, etc).  This patch attempts to centralize all of this into one place, and then updates compiler-rt to demonstrate as a proof of concept how this can simplify code.


https://reviews.llvm.org/D37637

Files:
  compiler-rt/CMakeLists.txt
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37637.114409.patch
Type: text/x-patch
Size: 5304 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170908/d08fee82/attachment.bin>


More information about the llvm-commits mailing list