[libcxx] Add a dependency on unwind in cxx_static, if LIBCXXABI_USE_LLVM_UNWINDER is set

Even if building cxx_static in itself doesn't actually link in the
requested unwinder, add a synthetic dependency so that building
cxx_static makes sure that the unwinder that was requested to be used
also gets built.

This makes sure that tests (when run with just a plain "ninja check-cxx")
actually use the newly built unwinder, as intended.

Differential Revision: https://reviews.llvm.org/D113467
This commit is contained in:
Martin Storsjö 2021-11-09 10:14:16 +02:00
parent ae5c52b933
commit b1c9d3d29a
1 changed files with 7 additions and 0 deletions

View File

@ -286,6 +286,13 @@ if (LIBCXX_ENABLE_STATIC)
cxx_add_common_build_flags(cxx_static)
cxx_set_common_defines(cxx_static)
if (LIBCXXABI_USE_LLVM_UNWINDER)
# If we intend to use the just-built unwinder, add a dependency so that it
# gets built, even if we technically aren't going to link it in at this
# stage.
add_dependencies(cxx_static unwind)
endif()
if (LIBCXX_HERMETIC_STATIC_LIBRARY)
# If the hermetic library doesn't define the operator new/delete functions
# then its code shouldn't declare them with hidden visibility. They might