Skip to content

Commit 1787bd1

Browse files
committed
arm64 compat
1 parent a154f3e commit 1787bd1

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ if(ENABLE_LIBUNWIND AND UNIX AND NOT ANDROID)
6464
if(LIBUNWIND_ARCH_LIB)
6565
list(APPEND LIBUNWIND_LIBRARIES ${LIBUNWIND_ARCH_LIB})
6666
endif()
67+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64")
68+
find_library(LIBUNWIND_ARCH_LIB unwind-aarch64)
69+
if(LIBUNWIND_ARCH_LIB)
70+
list(APPEND LIBUNWIND_LIBRARIES ${LIBUNWIND_ARCH_LIB})
71+
endif()
6772
endif()
6873
set(LIBUNWIND_FOUND TRUE)
6974
endif()
@@ -83,6 +88,16 @@ if(ENABLE_LIBUNWIND AND UNIX AND NOT ANDROID)
8388
message(WARNING "libunwind-x86_64 not found; stack traces may fail to link on x86_64.")
8489
endif()
8590
endif()
91+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64")
92+
list(JOIN LIBUNWIND_LIBRARIES ";" _libunwind_libs_joined)
93+
if(NOT _libunwind_libs_joined MATCHES "unwind-aarch64")
94+
find_library(LIBUNWIND_ARCH_LIB unwind-aarch64)
95+
if(LIBUNWIND_ARCH_LIB)
96+
list(APPEND LIBUNWIND_LIBRARIES ${LIBUNWIND_ARCH_LIB})
97+
else()
98+
message(WARNING "libunwind-aarch64 not found; stack traces may fail to link on aarch64.")
99+
endif()
100+
endif()
86101
endif()
87102
set(HAVE_LIBUNWIND ON)
88103
message(STATUS "libunwind found - LIBUNWIND_LIBRARIES=${LIBUNWIND_LIBRARIES}")

0 commit comments

Comments
 (0)