Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
glog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
glog
Commits
19570c69
Commit
19570c69
authored
Nov 01, 2019
by
Sergiu Deitsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed and cleaned up the unwind find module
parent
742fe94f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
56 deletions
+77
-56
CMakeLists.txt
CMakeLists.txt
+1
-1
FindLibunwind.cmake
cmake/FindLibunwind.cmake
+0
-55
FindUnwind.cmake
cmake/FindUnwind.cmake
+76
-0
No files found.
CMakeLists.txt
View file @
19570c69
...
...
@@ -117,7 +117,7 @@ check_symbol_exists (snprintf stdio.h HAVE_SNPRINTF)
check_library_exists
(
dbghelp UnDecorateSymbolName
""
HAVE_DBGHELP
)
find_package
(
Libu
nwind
)
find_package
(
U
nwind
)
check_c_source_compiles
(
"
#include <stdlib.h>
...
...
cmake/FindLibunwind.cmake
deleted
100644 → 0
View file @
742fe94f
# - Try to find libunwind
# Once done this will define
#
# Libunwind_FOUND - system has libunwind
# unwind - cmake target for libunwind
find_library
(
UNWIND_LIBRARY NAMES unwind DOC
"unwind library"
)
include
(
CheckIncludeFile
)
check_include_file
(
libunwind.h HAVE_LIBUNWIND_H
)
check_include_file
(
unwind.h HAVE_UNWIND_H
)
if
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^arm"
)
set
(
LIBUNWIND_ARCH
"arm"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^aarch64"
)
set
(
LIBUNWIND_ARCH
"aarch64"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR STREQUAL
"x86_64"
OR
CMAKE_SYSTEM_PROCESSOR STREQUAL
"amd64"
OR
CMAKE_SYSTEM_PROCESSOR STREQUAL
"corei7-64"
)
set
(
LIBUNWIND_ARCH
"x86_64"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^i.86$"
)
set
(
LIBUNWIND_ARCH
"x86"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^ppc64"
)
set
(
LIBUNWIND_ARCH
"ppc64"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^ppc"
)
set
(
LIBUNWIND_ARCH
"ppc32"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^mips"
)
set
(
LIBUNWIND_ARCH
"mips"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^hppa"
)
set
(
LIBUNWIND_ARCH
"hppa"
)
elseif
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"^ia64"
)
set
(
LIBUNWIND_ARCH
"ia64"
)
endif
()
find_library
(
UNWIND_LIBRARY_PLATFORM NAMES
"unwind-
${
LIBUNWIND_ARCH
}
"
DOC
"unwind library platform"
)
if
(
UNWIND_LIBRARY_PLATFORM
)
set
(
HAVE_LIB_UNWIND
"1"
)
endif
()
include
(
FindPackageHandleStandardArgs
)
# handle the QUIETLY and REQUIRED arguments and set Libunwind_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args
(
Libunwind DEFAULT_MSG
UNWIND_LIBRARY HAVE_LIBUNWIND_H HAVE_UNWIND_H HAVE_LIB_UNWIND
)
mark_as_advanced
(
UNWIND_LIBRARY UNWIND_LIBRARY_PLATFORM
)
if
(
Libunwind_FOUND
)
add_library
(
unwind INTERFACE IMPORTED
)
set_target_properties
(
unwind PROPERTIES
INTERFACE_LINK_LIBRARIES
"
${
UNWIND_LIBRARY
}
;
${
UNWIND_LIBRARY_PLATFORM
}
"
)
else
()
message
(
"Can't find libunwind library"
)
endif
()
cmake/FindUnwind.cmake
0 → 100644
View file @
19570c69
# - 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
)
# Extract version information
if
(
Unwind_LIBRARY
)
set
(
_Unwind_VERSION_HEADER
${
Unwind_INCLUDE_DIR
}
/libunwind-common.h
)
if
(
EXISTS
${
_Unwind_VERSION_HEADER
}
)
FILE
(
READ
${
_Unwind_VERSION_HEADER
}
_Unwind_VERSION_CONTENTS
)
string
(
REGEX REPLACE
".*#define UNW_VERSION_MAJOR[
\t
]+([0-9]+).*"
"
\\
1"
Unwind_VERSION_MAJOR
"
${
_Unwind_VERSION_CONTENTS
}
"
)
string
(
REGEX REPLACE
".*#define UNW_VERSION_MINOR[
\t
]+([0-9]+).*"
"
\\
1"
Unwind_VERSION_MINOR
"
${
_Unwind_VERSION_CONTENTS
}
"
)
string
(
REGEX REPLACE
".*#define UNW_VERSION_EXTRA[
\t
]+([0-9]+).*"
"
\\
1"
Unwind_VERSION_PATCH
"
${
_Unwind_VERSION_CONTENTS
}
"
)
set
(
Unwind_VERSION
${
Unwind_VERSION_MAJOR
}
.
${
Unwind_VERSION_MINOR
}
.
${
Unwind_VERSION_PATCH
}
)
set
(
Unwind_VERSION_COMPONENTS 3
)
endif
(
EXISTS
${
_Unwind_VERSION_HEADER
}
)
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
)
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment