Provide a meaningful diagnostic when LLVM_PATH doesn't point to a directory
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@369312 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake
index 4420aca..c43308e 100644
--- a/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -9,6 +9,9 @@
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
+ if (NOT IS_DIRECTORY "${LLVM_PATH}")
+ message(FATAL_ERROR "The provided LLVM_PATH (${LLVM_PATH}) is not a valid directory")
+ endif()
elseif(LLVM_CONFIG_PATH)
message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
set(LIBCXXABI_USING_INSTALLED_LLVM 1)