Skip to content

Commit 1c71e3a

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 7f65cc2 commit 1c71e3a

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

468468
if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
469-
find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
469+
find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
470470
PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
471471
${LIBCXXABI_LIBUNWIND_PATH}/include
472472
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
@@ -477,18 +477,23 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
477477
NO_CMAKE_FIND_ROOT_PATH
478478
)
479479

480-
if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
481-
set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
480+
if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
481+
set(LIBCXXABI_LIBUNWIND_INCLUDES "")
482482
endif()
483483
endif()
484484

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

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

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

0 commit comments

Comments
 (0)