Skip to content

Commit 5a14c17

Browse files
committed
Provide a meaningful diagnostic when LLVM_PATH doesn't point to a directory
llvm-svn: 369312
1 parent 9f985dd commit 5a14c17

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ macro(find_llvm_parts)
99
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
1010
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
1111
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
12+
if (NOT IS_DIRECTORY "${LLVM_PATH}")
13+
message(FATAL_ERROR "The provided LLVM_PATH (${LLVM_PATH}) is not a valid directory")
14+
endif()
1215
elseif(LLVM_CONFIG_PATH)
1316
message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
1417
set(LIBCXX_USING_INSTALLED_LLVM 1)

libcxxabi/cmake/Modules/HandleOutOfTreeLLVM.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ macro(find_llvm_parts)
99
set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
1010
set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
1111
set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
12+
if (NOT IS_DIRECTORY "${LLVM_PATH}")
13+
message(FATAL_ERROR "The provided LLVM_PATH (${LLVM_PATH}) is not a valid directory")
14+
endif()
1215
elseif(LLVM_CONFIG_PATH)
1316
message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
1417
set(LIBCXXABI_USING_INSTALLED_LLVM 1)

0 commit comments

Comments
 (0)