diff options
-rw-r--r-- | libcxx/CMakeLists.txt | 8 | ||||
-rw-r--r-- | libcxx/test/CMakeLists.txt | 15 |
2 files changed, 14 insertions, 9 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index da9322e9ef2..2928fc4f23d 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -19,7 +19,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ) - if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(libcxx CXX C) @@ -600,10 +599,15 @@ add_subdirectory(lib) if (LIBCXX_INCLUDE_BENCHMARKS) add_subdirectory(benchmarks) endif() + +# Create the lit.site.cfg file even when LIBCXX_INCLUDE_TESTS is OFF or +# LLVM_FOUND is OFF. This allows users to run the tests manually using +# LIT without requiring a full LLVM checkout. +add_subdirectory(test) if (LIBCXX_INCLUDE_TESTS) - add_subdirectory(test) add_subdirectory(lib/abi) endif() + if (LIBCXX_INCLUDE_DOCS) add_subdirectory(docs) endif() diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt index ed183bc41cd..a047c430778 100644 --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -1,5 +1,3 @@ -include(AddLLVM) # for add_lit_testsuite - macro(pythonize_bool var) if (${var}) set(${var} True) @@ -66,12 +64,15 @@ if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) list(APPEND LIBCXX_TEST_DEPS cxx_external_threads) endif() -add_lit_testsuite(check-cxx - "Running libcxx tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS cxx ${LIBCXX_TEST_DEPS}) +if (LIBCXX_INCLUDE_TESTS) + include(AddLLVM) # for add_lit_testsuite + add_lit_testsuite(check-cxx + "Running libcxx tests" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS cxx ${LIBCXX_TEST_DEPS}) -add_custom_target(check-libcxx DEPENDS check-cxx) + add_custom_target(check-libcxx DEPENDS check-cxx) +endif() if (LIBCXX_GENERATE_COVERAGE) include(CodeCoverage) |