-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
48 lines (41 loc) · 1.19 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
# cmake_minimum_required(VERSION 3.10)
# project(cpu_watcher VERSION 1.0)
# set(CMAKE_C_STANDARD 11)
# set(CMAKE_C_FLAGS "-g -Wall")
# include_directories(
# -I.output
# -I../../../libbpf/include/uapi
# -I../vmlinux/x86/
# -I/home/ne0/sys_competition/start/blazesym/include
# -I./include
# )
# set(SOURCE_FILES
# controller.c
# cpu_watcher.c
# )
# add_executable(cpu_watcher $\{SOURCE_FILES\})
# target_link_libraries(cpu_watcher -lelf -lz -lstdc++)
cmake_minimum_required(VERSION 3.10)
project(cpu_watcher VERSION 1.0)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_FLAGS "-g -Wall")
# 使用 target_include_directories 而不是 include_directories
include_directories(
${CMAKE_SOURCE_DIR}/.output
${CMAKE_SOURCE_DIR}/../../../libbpf/include/uapi
${CMAKE_SOURCE_DIR}/../vmlinux/x86/
${CMAKE_SOURCE_DIR}/home/ne0/sys_competition/start/blazesym/include
${CMAKE_SOURCE_DIR}/./include
)
set(SOURCE_FILES
sys_spy.c
)
# 添加目标文件
add_executable(cpu_watcher ${SOURCE_FILES})
# 确保链接所需的库,且包含 libblazesym 的路径
target_link_libraries(cpu_watcher
-lelf
-lz
-lstdc++
${CMAKE_SOURCE_DIR}/../blazesym/target/release/libblazesym.a
)