Skip to content

Commit eade5d4

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 c25a5e0 commit eade5d4

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

474474
if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
475-
find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
475+
find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
476476
PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
477477
${LIBCXXABI_LIBUNWIND_PATH}/include
478478
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
@@ -483,18 +483,23 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
483483
NO_CMAKE_FIND_ROOT_PATH
484484
)
485485

486-
if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
487-
set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
486+
if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
487+
set(LIBCXXABI_LIBUNWIND_INCLUDES "")
488488
endif()
489489
endif()
490490

491-
if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}" STREQUAL "")
492-
include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
491+
if (NOT "${LIBCXXABI_LIBUNWIND_INCLUDES}" STREQUAL "")
492+
include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
493493
endif()
494494

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

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

0 commit comments

Comments
 (0)