summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt30
1 files changed, 21 insertions, 9 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 824dff51865d3..9826de38c3c7b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -15,6 +15,11 @@ endfunction()
set(LLDB_TEST_DEPS lldb)
+# darwin-debug is an hard dependency for the testsuite.
+if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ list(APPEND LLDB_TEST_DEPS darwin-debug)
+endif()
+
if(TARGET lldb-server)
list(APPEND LLDB_TEST_DEPS lldb-server)
endif()
@@ -27,10 +32,6 @@ if(TARGET lldb-mi)
list(APPEND LLDB_TEST_DEPS lldb-mi)
endif()
-if ("${LLDB_TEST_COMPILER}" STREQUAL "")
- string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
-endif()
-
# The default architecture with which to compile test executables is the default LLVM target
# architecture, which itself defaults to the host architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH)
@@ -43,10 +44,6 @@ set(LLDB_TEST_ARCH
${LLDB_DEFAULT_TEST_ARCH}
CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64")
-if(LLDB_TEST_CLANG)
- set(LLDB_TEST_COMPILER $<TARGET_FILE:clang>)
-endif()
-
# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script
set(LLDB_TEST_USER_ARGS
""
@@ -60,7 +57,7 @@ set(LLDB_TEST_COMMON_ARGS
-S nm
-u CXXFLAGS
-u CFLAGS
- -C ${LLDB_TEST_COMPILER}
+ -C ${LLDB_TEST_C_COMPILER}
)
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
@@ -117,6 +114,21 @@ 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()
+
+# LLD is required to link test executables on Windows.
+if (CMAKE_SYSTEM_NAME MATCHES "Windows")
+ if (TARGET lld)
+ add_dependencies(check-lldb lld)
+ else ()
+ message(WARNING "lld required to test LLDB on Windows")
+ endif ()
+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.