Skip to content

Commit 8cb83fd

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 f653271 commit 8cb83fd

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
@@ -465,7 +465,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
465465
"Specify path to libunwind source." FORCE)
466466

467467
if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
468-
find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
468+
find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
469469
PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
470470
${LIBCXXABI_LIBUNWIND_PATH}/include
471471
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
@@ -476,18 +476,23 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
476476
NO_CMAKE_FIND_ROOT_PATH
477477
)
478478

479-
if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
480-
set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
479+
if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
480+
set(LIBCXXABI_LIBUNWIND_INCLUDES "")
481481
endif()
482482
endif()
483483

484-
if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "")
485-
include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
484+
if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES}" STREQUAL "")
485+
include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
486486
endif()
487487

488488
add_custom_target(cxxabi-test-depends
489489
COMMENT "Build dependencies required to run the libc++abi test suite.")
490490

491+
set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
492+
"Specify path to libunwind includes." FORCE)
493+
set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
494+
"Specify path to libunwind source." FORCE)
495+
491496
# Add source code. This also contains all of the logic for deciding linker flags
492497
# soname, etc...
493498
add_subdirectory(include)

0 commit comments

Comments
 (0)