[libunwind] r338819 - [CMake] Allow building standalone without any llvm-config available
Martin Storsjo via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 2 22:51:31 PDT 2018
Author: mstorsjo
Date: Thu Aug 2 22:51:31 2018
New Revision: 338819
URL: http://llvm.org/viewvc/llvm-project?rev=338819&view=rev
Log:
[CMake] Allow building standalone without any llvm-config available
This is the same as libcxxabi/libcxx do.
Differential Revision: https://reviews.llvm.org/D50135
Modified:
libunwind/trunk/CMakeLists.txt
Modified: libunwind/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libunwind/trunk/CMakeLists.txt?rev=338819&r1=338818&r2=338819&view=diff
==============================================================================
--- libunwind/trunk/CMakeLists.txt (original)
+++ libunwind/trunk/CMakeLists.txt Thu Aug 2 22:51:31 2018
@@ -66,9 +66,10 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR
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_CURR
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()
More information about the cfe-commits
mailing list