Skip to content

Commit

Permalink
fix(libscap): restore configurable cmake variables
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Jan 3, 2024
1 parent ba53ca2 commit 9a8360c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions userspace/libscap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,22 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
endif()

# do not remove this since when WITH_DRIVER is off
set(DRIVER_NAME "scap" CACHE STRING _)
if(NOT DEFINED DRIVER_NAME)
set(DRIVER_NAME "scap")
endif()

string(REPLACE "-" "_" SCAP_KERNEL_MODULE_NAME "${DRIVER_NAME}")
add_definitions(-DSCAP_KERNEL_MODULE_NAME="${SCAP_KERNEL_MODULE_NAME}")
endif()

set(SCAP_HOST_ROOT_ENV_VAR_NAME "HOST_ROOT" CACHE STRING _)
if(NOT DEFINED SCAP_HOST_ROOT_ENV_VAR_NAME)
set(SCAP_HOST_ROOT_ENV_VAR_NAME "HOST_ROOT")
endif()
add_definitions(-DSCAP_HOST_ROOT_ENV_VAR_NAME="${SCAP_HOST_ROOT_ENV_VAR_NAME}")

set(SCAP_HOSTNAME_ENV_VAR "SCAP_HOSTNAME" CACHE STRING _)
if(NOT DEFINED SCAP_HOSTNAME_ENV_VAR)
set(SCAP_HOSTNAME_ENV_VAR "SCAP_HOSTNAME")
endif()
add_definitions(-DSCAP_HOSTNAME_ENV_VAR="${SCAP_HOSTNAME_ENV_VAR}")

if (DEFINED SCAP_BPF_PROGS_TAIL_CALLED_MAX)
Expand Down

0 comments on commit 9a8360c

Please sign in to comment.