Index: libcxxabi/CMakeLists.txt =================================================================== --- libcxxabi/CMakeLists.txt +++ libcxxabi/CMakeLists.txt @@ -481,7 +481,7 @@ add_subdirectory(src) if (LIBCXXABI_INCLUDE_TESTS) - if (LIBCXXABI_STANDALONE_BUILD AND NOT LIBCXXABI_ENABLE_SHARED) + if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND NOT LIBCXXABI_ENABLE_SHARED) # We can't reasonably test the system C++ library with a static # libc++abi. We either need to be able to replace libc++abi at # run time (with a shared libc++abi), or we need to be able to Index: libunwind/CMakeLists.txt =================================================================== --- libunwind/CMakeLists.txt +++ libunwind/CMakeLists.txt @@ -363,6 +363,6 @@ add_subdirectory(docs) endif() -if (EXISTS ${LLVM_CMAKE_PATH}) +if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR EXISTS ${LLVM_CMAKE_PATH}) add_subdirectory(test) endif()