diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2015-05-08 16:10:11 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2015-05-08 16:10:11 +0000 |
commit | c50966088edc0ab80196afce6cc50a56f08eff78 (patch) | |
tree | b26a39ab3f676b2c956b1f0c55f09a6fe3baaa2b /CMakeLists.txt | |
parent | b979db159a515fe12b54f793690618313e017259 (diff) |
Fix "TODO" and provide the configure-time options to find libunwind.
This is done the same way as we're looking for libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@236874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ffd300..0abdd8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,13 +299,38 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") # Setup Source Code #=============================================================================== +set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH + "Specify path to libunwind includes." FORCE) +set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH + "Specify path to libunwind source." FORCE) + include_directories(include) if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM) - include_directories(${LLVM_MAIN_SRC_DIR}/projects/libunwind/include) - # TODO: libunwind does not place libunwind_ext.h into include, so we need to - # reach into its source directory. This is primarily for - # _Unwind_VRS_Interpret, which is part of ARM EHABI, and should be in unwind.h - include_directories(${LLVM_MAIN_SRC_DIR}/projects/libunwind/src) + find_path( + LIBCXXABI_LIBUNWIND_INCLUDES + libunwind.h + PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES} + ${LIBCXXABI_LIBUNWIND_PATH}/include + ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES} + ${LLVM_MAIN_SRC_DIR}/projects/libunwind/include + ) + + find_path( + LIBCXXABI_LIBUNWIND_SOURCES + libunwind_ext.h + PATHS ${LIBCXXABI_LIBUNWIND_PATH}/src/ + ${LIBCXXABI_LIBUNWIND_INCLUDES}/../src/ + ${LLVM_MAIN_SRC_DIR}/projects/libunwind/src/ + NO_DEFAULT_PATH + ) + + if (LIBCXXABI_LIBUNWIND_SOURCES STREQUAL "LIBCXXABI_LIBUNWIND_PATH-NOTFOUND") + message(WARNING "LIBCXXABI_LIBCXX_PATH was not specified and couldn't be infered.") + set(LIBCXXABI_LIBUNWIND_PATH "") + endif() + + include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}") + include_directories("${LIBCXXABI_LIBUNWIND_SOURCES}") endif () # Add source code. This also contains all of the logic for deciding linker flags |