[libcxx-commits] [PATCH] D97314: [libc++abi] Link against cxx-headers when available

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 25 12:04:22 PST 2021

ldionne added a comment.

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?

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list