CMake: Only add test/ subdirectory when it exists
r296685 started adding the test/ subdirectory even when LIBCXX_INCLUDE_TESTS=OFF. This is great for testing libcxx standalone, but it also breaks the build when the test/ subdirectory is removed (and our submission system strips all test/ directories). This patch updates the logic to check for test/ before adding it. rdar://problem/31931366 llvm-svn: 302095
This commit is contained in:
parent
739a7b2f9c
commit
8e5f0409fb
|
@ -627,7 +627,12 @@ endif()
|
||||||
# Create the lit.site.cfg file even when LIBCXX_INCLUDE_TESTS is OFF or
|
# 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
|
# LLVM_FOUND is OFF. This allows users to run the tests manually using
|
||||||
# LIT without requiring a full LLVM checkout.
|
# 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)
|
add_subdirectory(test)
|
||||||
|
endif()
|
||||||
if (LIBCXX_INCLUDE_TESTS)
|
if (LIBCXX_INCLUDE_TESTS)
|
||||||
add_subdirectory(lib/abi)
|
add_subdirectory(lib/abi)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue