Skip to content

Commit cacf04b

Browse files
committed
libcxxabi: Find libunwind headers when LIBCXXABI_LIBUNWIND_INCLUDES is set
Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments then it ends up not searching the specified dir and unwind.h is not found especially for ARM targets This patch makes the searching synthesized directories and then set LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment Upstream-Status: Pending Signed-off-by: Khem Raj <raj.khem@gmail.com>
1 parent a695d6b commit cacf04b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

libcxxabi/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
470470
"Specify path to libunwind source." FORCE)
471471

472472
if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
473-
find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
473+
find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
474474
PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
475475
${LIBCXXABI_LIBUNWIND_PATH}/include
476476
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
@@ -481,18 +481,23 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
481481
NO_CMAKE_FIND_ROOT_PATH
482482
)
483483

484-
if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
485-
set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
484+
if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
485+
set(LIBCXXABI_LIBUNWIND_INCLUDES "")
486486
endif()
487487
endif()
488488

489-
if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "")
490-
include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
489+
if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES}" STREQUAL "")
490+
include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
491491
endif()
492492

493493
add_custom_target(cxxabi-test-depends
494494
COMMENT "Build dependencies required to run the libc++abi test suite.")
495495

496+
set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
497+
"Specify path to libunwind includes." FORCE)
498+
set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
499+
"Specify path to libunwind source." FORCE)
500+
496501
# Add source code. This also contains all of the logic for deciding linker flags
497502
# soname, etc...
498503
add_subdirectory(include)

0 commit comments

Comments
 (0)