diff options
author | Martin Storsjo <martin@martin.st> | 2018-08-03 05:51:31 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-08-03 05:51:31 +0000 |
commit | c3150ee51c271f65094c19c5d535a04f4cb402f9 (patch) | |
tree | 72e705e815a18224cc689fde02fd7f58c6a77d4d /libunwind | |
parent | fb3909e49a38eced72c48d7f9985eb5f26703e09 (diff) |
[CMake] Allow building standalone without any llvm-config available
This is the same as libcxxabi/libcxx do.
Differential Revision: https://reviews.llvm.org/D50135
Diffstat (limited to 'libunwind')
-rw-r--r-- | libunwind/CMakeLists.txt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index 381a275c02a..d73c0ddfb60 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -66,9 +66,10 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm") endif() else() - message(FATAL_ERROR "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. " - "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config " - "or -DLLVM_PATH=path/to/llvm-source-root.") + message(WARNING "UNSUPPORTED LIBUNWIND CONFIGURATION DETECTED: " + "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. " + "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config " + "or -DLLVM_PATH=path/to/llvm-source-root.") endif() if (EXISTS ${LLVM_CMAKE_PATH}) @@ -76,7 +77,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) include("${LLVM_CMAKE_PATH}/AddLLVM.cmake") include("${LLVM_CMAKE_PATH}/HandleLLVMOptions.cmake") else() - message(FATAL_ERROR "Not found: ${LLVM_CMAKE_PATH}") + message(WARNING "Not found: ${LLVM_CMAKE_PATH}") endif() set(PACKAGE_NAME libunwind) @@ -366,4 +367,6 @@ if (LIBUNWIND_INCLUDE_DOCS) add_subdirectory(docs) endif() -add_subdirectory(test) +if (EXISTS ${LLVM_CMAKE_PATH}) + add_subdirectory(test) +endif() |