forked from libunwind/libunwind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (50 loc) · 1.78 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
project(libunwind)
cmake_minimum_required(VERSION 3.16.1)
set(CMAKE_C_STANDARD 11)
set(PKG_MAJOR "1")
set(PKG_MINOR "6")
set(PKG_EXTRA "-rc1")
set(PACKAGE_STRING "libunwind")
set(PACKAGE_BUGREPORT "")
if ('${TARGET}' STREQUAL 'x86_64-linux-gnu')
set(TARGET_AMD64 1)
set(arch x86_64)
add_definitions(-D__linux__)
elseif ('${TARGET}' STREQUAL 'i686-linux-gnu')
set(TARGET_X86 1)
set(arch x86)
add_definitions(-D__linux__)
elseif ('${TARGET}' STREQUAL 'aarch64-linux-gnu')
set(TARGET_AARCH64 1)
set(arch aarch64)
add_definitions(-D__aarch64__)
add_definitions(-D__linux__)
elseif ('${TARGET}' STREQUAL 'arm-linux-gnueabihf')
set(TARGET_ARM 1)
set(arch arm)
add_definitions(-D__arm__)
add_definitions(-D__linux__)
elseif ('${TARGET}' STREQUAL 's390x-linux-gnu')
set(TARGET_S390X 1)
set(arch s390x)
add_definitions(-D__s390x__)
add_definitions(-D__linux__)
elseif ('${TARGET}' STREQUAL 'loongarch64-linux-gnu')
set(TARGET_LOONGARCH64 1)
set(arch loongarch64)
add_definitions(-D__loongarch64)
add_definitions(-D__linux__)
else ()
message(FATAL_ERROR "Unrecognize value in environment variable TARGET")
endif ()
include(CheckCSourceCompiles)
include(CheckIncludeFiles)
# files for cross os compilation
include_directories(include/remote)
add_definitions(-DHAVE_CONFIG_H)
configure_file(include/config.h.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/include/config.h)
configure_file(include/libunwind-common.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/libunwind-common.h)
configure_file(include/libunwind.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/libunwind.h)
configure_file(include/tdep/libunwind_i.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/tdep/libunwind_i.h)
configure_file(include/tdep/dwarf-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/tdep/dwarf-config.h)
add_subdirectory(src)