-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renamed and cleaned up the unwind find module
- Loading branch information
Showing
3 changed files
with
57 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# - Try to find libunwind | ||
# Once done this will define | ||
# | ||
# Unwind_FOUND - system has libunwind | ||
# unwind::unwind - cmake target for libunwind | ||
|
||
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) | ||
|
||
# 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) | ||
|
||
if (Unwind_FOUND) | ||
add_library (unwind::unwind INTERFACE IMPORTED) | ||
|
||
set_property (TARGET unwind::unwind PROPERTY | ||
INTERFACE_INCLUDE_DIRECTORIES ${UNWIND_INCLUDE_DIR} | ||
) | ||
set_property (TARGET unwind::unwind PROPERTY | ||
INTERFACE_LINK_LIBRARIES ${UNWIND_LIBRARY} ${UNWIND_PLATFORM_LIBRARY} | ||
) | ||
set_property (TARGET unwind::unwind PROPERTY | ||
IMPORTED_CONFIGURATIONS RELEASE | ||
) | ||
endif (Unwind_FOUND) |