[libc++] Do not try creating llvm-lit when LIBCXX_INCLUDE_TESTS is OFF in the standalone build

Doing so doesn't work reliably, since it relies on LLVM_* implementation
detail variables being set. Furthermore, since we rely on the lit.site.cfg
being generated, running the tests requires LIBCXX_INCLUDE_TESTS=ON anyway.
This commit is contained in:
Louis Dionne
2020-06-29 11:51:15 -04:00
parent 226cda58d5
commit eb68a0ab5e

View File

@@ -916,28 +916,18 @@ 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.
#
# However, since some submission systems strip test/ subdirectories, check for
# it before adding it.
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
add_subdirectory(test)
endif()
if (LIBCXX_INCLUDE_TESTS)
add_subdirectory(test)
add_subdirectory(lib/abi)
endif()
if (LIBCXX_STANDALONE_BUILD AND EXISTS "${LLVM_MAIN_SRC_DIR}/utils/llvm-lit")
include(AddLLVM) # for get_llvm_lit_path
# Make sure the llvm-lit script is generated into the bin directory, and do
# it after adding all tests, since the generated script will only work
# correctly discovered tests against test locations from the source tree that
# have already been discovered.
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
if (LIBCXX_STANDALONE_BUILD)
include(AddLLVM) # for get_llvm_lit_path
# Make sure the llvm-lit script is generated into the bin directory, and
# do it after adding all tests, since the generated script will only work
# correctly discovered tests against test locations from the source tree
# that have already been discovered.
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
endif()
endif()
if (LIBCXX_INCLUDE_DOCS)