Skip to content

Commit 3911e98

Browse files
leogrpoiana
authored andcommitted
refactor: change semantic WITH_DRIVER to USE_BUNDLED_DRIVER
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
1 parent 04351a1 commit 3911e98

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ project(falcosecurity-libs)
3636

3737
option(MINIMAL_BUILD "Produce a minimal build with only the essential features (no eBPF probe driver, no kubernetes, no mesos, no marathon and no container metadata)" OFF)
3838
option(MUSL_OPTIMIZED_BUILD "Enable if you want a musl optimized build" OFF)
39+
option(USE_BUNDLED_DRIVER "Use the driver/ subdirectory in the build process (only available in Linux)" ON)
3940

4041
include(GNUInstallDirs)
4142

@@ -52,12 +53,16 @@ endif()
5253

5354
message(STATUS "Libs version: ${FALCOSECURITY_LIBS_VERSION}")
5455

55-
# Driver version
56-
if(NOT DEFINED DRIVER_VERSION)
57-
get_drivers_version(DRIVER_VERSION)
58-
endif()
56+
if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND USE_BUNDLED_DRIVER)
57+
# Driver version
58+
if(NOT DEFINED DRIVER_VERSION)
59+
get_drivers_version(DRIVER_VERSION)
60+
endif()
61+
62+
message(STATUS "Driver version: ${DRIVER_VERSION}")
5963

60-
message(STATUS "Driver version: ${DRIVER_VERSION}")
64+
add_subdirectory(driver ${PROJECT_BINARY_DIR}/driver)
65+
endif()
6166

6267
if(NOT CMAKE_BUILD_TYPE)
6368
SET(CMAKE_BUILD_TYPE Release)

userspace/libscap/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../common")
1717

1818
option(USE_BUNDLED_DEPS "Enable bundled dependencies instead of using the system ones" ON)
19-
option(WITH_DRIVER "Add the driver subdirectory in scap (only available in Linux)" ON)
2019

2120
if(NOT MSVC)
2221
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
@@ -40,12 +39,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
4039
set(KBUILD_FLAGS "${FALCOSECURITY_LIBS_DEBUG_FLAGS}")
4140
endif()
4241

43-
if(WITH_DRIVER)
44-
add_subdirectory(../../driver ${PROJECT_BINARY_DIR}/driver)
45-
endif()
46-
4742
# do not remove this since when WITH_DRIVER is off
48-
if (NOT DEFINED DRIVER_NAME)
43+
if(NOT DEFINED DRIVER_NAME)
4944
set(DRIVER_NAME "scap")
5045
endif()
5146

0 commit comments

Comments
 (0)