Skip to content

Commit

Permalink
update compile settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sy0307 committed Dec 23, 2024
1 parent 08190f2 commit 4d72459
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ endif()

message(STATUS "Started CMake for ${PROJECT_NAME} v${PROJECT_VERSION}...\n")

# option to use probe read/write checks
if(DEFINED ENABLE_PROBE_READ_CHECK)
add_compile_definitions(ENABLE_PROBE_READ_CHECK=1)
endif()

if(DEFINED ENABLE_PROBE_WRITE_CHECK)
add_compile_definitions(ENABLE_PROBE_WRITE_CHECK=1)
endif()

# if option to build without libbpf is set
if(${BPFTIME_BUILD_WITH_LIBBPF})
add_definitions(-DBPFTIME_BUILD_WITH_LIBBPF=1)
Expand Down Expand Up @@ -169,6 +160,15 @@ add_subdirectory(attach)

add_subdirectory(runtime)

# option to use probe read/write checks
if(DEFINED ENABLE_PROBE_READ_CHECK)
target_compile_definitions(runtime PRIVATE ENABLE_PROBE_READ_CHECK=1)
endif()

if(DEFINED ENABLE_PROBE_WRITE_CHECK)
target_compile_definitions(runtime PRIVATE ENABLE_PROBE_WRITE_CHECK=1)
endif()

# add to single archive if option is enabled
if(${BPFTIME_BUILD_STATIC_LIB})
set(UBPF_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/vm/ubpf-vm/ubpf)
Expand Down
8 changes: 7 additions & 1 deletion cmake/StandardSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,10 @@ option(BPFTIME_BUILD_KERNEL_BPF "Whether to build with bpf share maps" ON)
option(BPFTIME_BUILD_STATIC_LIB "Whether to build a single static library for different archive files" OFF)

# whether to build bpftime with libbpf and other linux headers
option(BPFTIME_BUILD_WITH_LIBBPF "Whether to build with libbpf and other linux headers" ON)
option(BPFTIME_BUILD_WITH_LIBBPF "Whether to build with libbpf and other linux headers" ON)

# whether to enable probe write check
option(ENABLE_PROBE_WRITE_CHECK "Whether to enable probe write check" OFF)

# whether to enable probe read check
option(ENABLE_PROBE_READ_CHECK "Whether to enable probe read check" OFF)

0 comments on commit 4d72459

Please sign in to comment.