From 9a8360c26d479f8bcb6911134294c59d2b3c0997 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Tue, 28 Nov 2023 17:52:00 +0000 Subject: [PATCH] fix(libscap): restore configurable cmake variables Signed-off-by: Roberto Scolaro --- userspace/libscap/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/userspace/libscap/CMakeLists.txt b/userspace/libscap/CMakeLists.txt index d50a9f84c4f..6ad84c32c52 100644 --- a/userspace/libscap/CMakeLists.txt +++ b/userspace/libscap/CMakeLists.txt @@ -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)