diff options
author | Louis Dionne <ldionne.2@gmail.com> | 2024-05-28 18:31:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-28 18:31:01 -0700 |
commit | bd135c3b9fb57e6346e4a790945809617388ca9b (patch) | |
tree | 99faf24a8527012eea982105309d79d09432cb3b /libcxxabi | |
parent | 633ea41b54bf7b2f10850bbd5ba3c4ab06081595 (diff) | |
download | llvm-bd135c3b9fb57e6346e4a790945809617388ca9b.zip llvm-bd135c3b9fb57e6346e4a790945809617388ca9b.tar.gz llvm-bd135c3b9fb57e6346e4a790945809617388ca9b.tar.bz2 |
[runtimes][CMake] Simplify the propagation of test dependencies (#93558)
Instead of using FOO_TEST_DEPS global variables that don't get updated
properly from subdirectories, use targets to propagate the dependencies
across directories.
Diffstat (limited to 'libcxxabi')
-rw-r--r-- | libcxxabi/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libcxxabi/src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | libcxxabi/test/CMakeLists.txt | 13 |
3 files changed, 5 insertions, 12 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index f7673da..86fe4a6 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -443,6 +443,9 @@ if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "") include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}") endif() +add_custom_target(cxxabi-test-depends + COMMENT "Build dependencies required to run the libc++abi test suite.") + # Add source code. This also contains all of the logic for deciding linker flags # soname, etc... add_subdirectory(include) diff --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt index c8cc93d..c54ced4 100644 --- a/libcxxabi/src/CMakeLists.txt +++ b/libcxxabi/src/CMakeLists.txt @@ -304,6 +304,7 @@ endif() # Add a meta-target for both libraries. add_custom_target(cxxabi DEPENDS ${LIBCXXABI_BUILD_TARGETS}) +add_dependencies(cxxabi-test-depends cxxabi cxx) if (LIBCXXABI_INSTALL_LIBRARY) install(TARGETS ${LIBCXXABI_INSTALL_TARGETS} diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt index cd908a3..8e3048f2 100644 --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -10,17 +10,6 @@ endmacro() pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER) -if (LIBCXXABI_ENABLE_SHARED) - set(LIBCXXABI_TEST_DEPS cxxabi_shared) -else() - set(LIBCXXABI_TEST_DEPS cxxabi_static) -endif() - -list(APPEND LIBCXXABI_TEST_DEPS cxx) -if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind) - list(APPEND LIBCXXABI_TEST_DEPS unwind) -endif() - set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!") set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n") @@ -59,4 +48,4 @@ configure_lit_site_cfg( add_lit_testsuite(check-cxxabi "Running libcxxabi tests" ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ${LIBCXXABI_TEST_DEPS}) + DEPENDS cxxabi-test-depends) |