aboutsummaryrefslogtreecommitdiff
path: root/libcxx/test
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2024-05-28 18:31:01 -0700
committerGitHub <noreply@github.com>2024-05-28 18:31:01 -0700
commitbd135c3b9fb57e6346e4a790945809617388ca9b (patch)
tree99faf24a8527012eea982105309d79d09432cb3b /libcxx/test
parent633ea41b54bf7b2f10850bbd5ba3c4ab06081595 (diff)
downloadllvm-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 'libcxx/test')
-rw-r--r--libcxx/test/CMakeLists.txt14
-rw-r--r--libcxx/test/tools/clang_tidy_checks/CMakeLists.txt2
2 files changed, 2 insertions, 14 deletions
diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index ee3502d..3c54a4e 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -1,11 +1,5 @@
include(HandleLitArguments)
add_subdirectory(tools)
-# When the tools add clang-tidy support, the dependencies need to be updated.
-# This cannot be done in the tools CMakeLists.txt since that does not update
-# the status in this (a parent) directory.
-if(TARGET cxx-tidy)
- list(APPEND LIBCXX_TEST_DEPS cxx-tidy)
-endif()
# By default, libcxx and libcxxabi share a library directory.
if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH)
@@ -40,10 +34,6 @@ endif()
serialize_lit_params_list(SERIALIZED_LIT_PARAMS LIBCXX_TEST_PARAMS)
-if (NOT DEFINED LIBCXX_TEST_DEPS)
- message(FATAL_ERROR "Expected LIBCXX_TEST_DEPS to be defined")
-endif()
-
if (MSVC)
# Shared code for initializing some parameters used by all
# llvm-libc++-*-clangcl.cfg.in test configs.
@@ -81,10 +71,6 @@ if (LIBCXX_INCLUDE_TESTS)
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")
- add_custom_target(cxx-test-depends
- DEPENDS cxx ${LIBCXX_TEST_DEPS}
- COMMENT "Builds dependencies required to run the test suite.")
-
add_lit_testsuite(check-cxx
"Running libcxx tests"
${CMAKE_CURRENT_BINARY_DIR}
diff --git a/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt b/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
index 28c1dbf..f0289dc 100644
--- a/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
+++ b/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
@@ -110,3 +110,5 @@ set_target_properties(cxx-tidy PROPERTIES
set_target_properties(cxx-tidy PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_SHARED_MODULE_SUFFIX_CXX .plugin) # Use a portable suffix to simplify how we can find it from Lit
+
+add_dependencies(cxx-test-depends cxx-tidy)