Skip to content

Commit

Permalink
cmake: do not search for platform specific unwind
Browse files Browse the repository at this point in the history
This change removes platform specific unwind lookup allowing the use of
LLVM unwind implementation.
  • Loading branch information
sergiud committed Dec 22, 2021
1 parent 4ffa983 commit 224f66b
Showing 1 changed file with 6 additions and 29 deletions.
35 changes: 6 additions & 29 deletions cmake/FindUnwind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,7 @@ include (FindPackageHandleStandardArgs)
find_path (Unwind_INCLUDE_DIR NAMES unwind.h libunwind.h DOC "unwind include directory")
find_library (Unwind_LIBRARY NAMES unwind DOC "unwind library")

if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
set (Unwind_ARCH "arm")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
set (Unwind_ARCH "aarch64")
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
CMAKE_SYSTEM_PROCESSOR STREQUAL "corei7-64")
set (Unwind_ARCH "x86_64")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
set (Unwind_ARCH "x86")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64")
set (Unwind_ARCH "ppc64")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
set (Unwind_ARCH "ppc32")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
set (Unwind_ARCH "mips")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^hppa")
set (Unwind_ARCH "hppa")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ia64")
set (Unwind_ARCH "ia64")
endif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")

find_library (Unwind_PLATFORM_LIBRARY NAMES "unwind-${Unwind_ARCH}"
DOC "unwind library platform")

mark_as_advanced (Unwind_INCLUDE_DIR Unwind_LIBRARY Unwind_PLATFORM_LIBRARY)
mark_as_advanced (Unwind_INCLUDE_DIR Unwind_LIBRARY)

# Extract version information
if (Unwind_LIBRARY)
Expand Down Expand Up @@ -64,8 +39,10 @@ endif (Unwind_LIBRARY)

# handle the QUIETLY and REQUIRED arguments and set Unwind_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args (Unwind REQUIRED_VARS Unwind_INCLUDE_DIR
Unwind_LIBRARY Unwind_PLATFORM_LIBRARY VERSION_VAR Unwind_VERSION)
find_package_handle_standard_args (Unwind
REQUIRED_VARS Unwind_INCLUDE_DIR Unwind_LIBRARY
VERSION_VAR Unwind_VERSION
)

if (Unwind_FOUND)
if (NOT TARGET unwind::unwind)
Expand All @@ -75,7 +52,7 @@ if (Unwind_FOUND)
INTERFACE_INCLUDE_DIRECTORIES ${Unwind_INCLUDE_DIR}
)
set_property (TARGET unwind::unwind PROPERTY
INTERFACE_LINK_LIBRARIES ${Unwind_LIBRARY} ${Unwind_PLATFORM_LIBRARY}
INTERFACE_LINK_LIBRARIES ${Unwind_LIBRARY}
)
set_property (TARGET unwind::unwind PROPERTY
IMPORTED_CONFIGURATIONS RELEASE
Expand Down

0 comments on commit 224f66b

Please sign in to comment.