From 4ab13cda813ef15f3254b68b8c22bdaa76732ad1 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Fri, 27 Oct 2017 21:22:57 +0000 Subject: [PATCH] [CMake] Build clang as dependency when using in-tree clang for tests. Discussed with Zachary Turner and Pavel Labath on lldb-dev. Let's hope this doesn't break anything :) llvm-svn: 316800 --- lldb/lit/CMakeLists.txt | 6 ++++++ lldb/test/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lldb/lit/CMakeLists.txt b/lldb/lit/CMakeLists.txt index 84c9198..925b833 100644 --- a/lldb/lit/CMakeLists.txt +++ b/lldb/lit/CMakeLists.txt @@ -54,6 +54,12 @@ add_lit_testsuite(check-lldb-lit "Running lldb lit test suite" set_target_properties(check-lldb-lit PROPERTIES FOLDER "LLDB tests") +# If we're building with an in-tree clang, then list clang as a dependency +# to run tests. +if (TARGET clang) + add_dependencies(check-lldb-lit clang) +endif() + add_lit_testsuites(LLDB ${CMAKE_CURRENT_SOURCE_DIR} PARAMS lldb_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg lldb_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt index d5d71d1..958f9f3 100644 --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -109,6 +109,12 @@ add_python_test_target(check-lldb "Testing LLDB (parallel execution, with a separate subprocess per test)" ) +# If we're building with an in-tree clang, then list clang as a dependency +# to run tests. +if (TARGET clang) + add_dependencies(check-lldb clang) +endif() + add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS}) # This will add LLDB's test dependencies to the depenednecies for check-all and # include them in the test-depends target. -- 2.7.4