[libcxx-commits] [PATCH] D97314: [libc++abi] Link against cxx-headers when available
Petr Hosek via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 25 14:18:19 PST 2021
phosek added a comment.
In D97314#2588445 <https://reviews.llvm.org/D97314#2588445>, @ldionne wrote:
> In D97314#2585569 <https://reviews.llvm.org/D97314#2585569>, @phosek wrote:
>> I'm a bit worried about using `TARGET cxx-headers`. Whether that evaluates to `TRUE` or `FALSE` depends on the order of target evaluation, which in this case is determined by the order in which you put projects into `LLVM_ENABLE_PROJECTS`/`LLVM_ENABLE_RUNTIMES`. I ran into this recently in D97256 <https://reviews.llvm.org/D97256>. Ideally we would use generator expressions but they don't support dependencies <https://gitlab.kitware.com/cmake/cmake/-/issues/19467>. Alternative is to either use patterns like `"libcxx" IN_LIST LLVM_ENABLE_RUNTIMES` or canonicalizing the order in which we process targets (which we already do in some cases <https://github.com/llvm/llvm-project/blob/c2487bf7dfdda59b775b3d5a06684af243790125/runtimes/CMakeLists.txt#L57>). @smeenai, @beanz, @compnerd do you have any thoughts on this/other ideas?
> Could we create those targets upfront regardless of the order projects are included in? And then we'd populate those targets later on in their respective CMake files, but at least they would be visible globally. Kind of like introducing a forward-declaration in C++ to break circular dependencies.
> Would that make sense?
That's an interesting idea, I haven't thought of that but I like it. The question is where would those targets get defined. Could we use the top-level runtimes build <https://github.com/llvm/llvm-project/blob/main/runtimes/CMakeLists.txt> for that purpose?
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the libcxx-commits