-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
41 lines (34 loc) · 1.27 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
cmake_minimum_required(VERSION 3.0)
project(tinydbg)
set(CMAKE_CXX_STANDARD 17)
include_directories(
thirdparty/libelfin
thirdparty/linenoise)
add_executable(tinydbg
src/main.cpp
src/breakpoint.cpp src/breakpoint.h
src/debugger.cpp src/debugger.h
src/registers.cpp src/registers.h
src/symbol.cpp src/symbol.h
thirdparty/linenoise/linenoise.c)
add_executable(hello example/hello.cpp)
set_target_properties(hello
PROPERTIES COMPILE_FLAGS "-g -O0")
add_executable(variables example/variables.cpp)
set_target_properties(variables
PROPERTIES COMPILE_FLAGS "-gdwarf-2 -O0")
add_executable(unwinding example/stack_unwinding.cpp)
set_target_properties(unwinding
PROPERTIES COMPILE_FLAGS "-g -O0")
add_executable(backtrace example/backtrace.cpp)
set_target_properties(backtrace
PROPERTIES COMPILE_FLAGS "-g -O0 -fno-omit-frame-pointer")
add_custom_target(
libelfin
COMMAND make
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/thirdparty/libelfin
)
target_link_libraries(tinydbg
${PROJECT_SOURCE_DIR}/thirdparty/libelfin/dwarf/libdwarf++.so
${PROJECT_SOURCE_DIR}/thirdparty/libelfin/elf/libelf++.so)
add_dependencies(tinydbg libelfin)