-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (38 loc) · 1.07 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
cmake_minimum_required(VERSION 3.14)
project(
glibc-tools
VERSION 0.0.1
LANGUAGES C CXX
)
set(ARCH "x86_64" CACHE STRING "Architecture to build for.")
set(CPPTRACE_TAG "v0.7.5" CACHE STRING "Cpptrace git tag")
include(FetchContent)
FetchContent_Declare(
cpptrace
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
GIT_TAG ${CPPTRACE_TAG}
)
FetchContent_MakeAvailable(cpptrace)
add_library(
SegFault
SHARED
libSegFault/config.cpp
libSegFault/segfault.cpp
libSegFault/_itoa.cpp
libSegFault/signal-safe-trace.cpp
)
target_include_directories(SegFault PRIVATE libSegFault/${ARCH} libSegFault/) # Note: Order is important
target_compile_definitions(SegFault PRIVATE _GNU_SOURCE)
target_link_libraries(SegFault cpptrace::cpptrace)
target_compile_features(SegFault PRIVATE cxx_std_20)
add_executable(
tracer
tracer/main.cpp
)
target_link_libraries(tracer cpptrace::cpptrace)
target_compile_features(tracer PRIVATE cxx_std_20)
add_executable(
faulty-example
faulty-example/faulty-example.cpp
)
target_compile_features(faulty-example PRIVATE cxx_std_11)