summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2017-05-03 23:33:54 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2017-05-03 23:33:54 +0000
commit59a094fac7eb222dd0c873d3eb0fe0a2c154dab3 (patch)
treeae359e6358b530f04da49a9c0185dcfee9316ec3 /CMakeLists.txt
parent16d4a3f21c3eee853579b06619d9a3a1a1de7825 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ef1726b78..b062609c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -627,7 +627,12 @@ 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)
+#
+# 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(lib/abi)
endif()