Skip to content

Commit

Permalink
[libcxx] Add a dependency on unwind in cxx_static, if LIBCXXABI_USE_L…
Browse files Browse the repository at this point in the history
…LVM_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
  • Loading branch information
mstorsjo committed Nov 9, 2021
1 parent ae5c52b commit b1c9d3d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libcxx/src/CMakeLists.txt
Expand Up @@ -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
Expand Down

0 comments on commit b1c9d3d

Please sign in to comment.