diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b0c74d7..bb593992 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,7 @@ cmake_minimum_required(VERSION 3.5.1) project(falco) option(USE_BUNDLED_DEPS "Bundle hard to find dependencies into the Falco binary" OFF) +option(USE_DYNAMIC_LIBELF "Dynamically link libelf" ON) option(BUILD_WARNINGS_AS_ERRORS "Enable building with -Wextra -Werror flags" OFF) option(MINIMAL_BUILD "Build a minimal version of Falco, containing only the engine and basic input/output (EXPERIMENTAL)" OFF) option(MUSL_OPTIMIZED_BUILD "Enable if you want a musl optimized build" OFF) diff --git a/cmake/modules/falcosecurity-libs.cmake b/cmake/modules/falcosecurity-libs.cmake index 25aa8b14..dff89949 100644 --- a/cmake/modules/falcosecurity-libs.cmake +++ b/cmake/modules/falcosecurity-libs.cmake @@ -87,6 +87,10 @@ set(USE_BUNDLED_NLOHMANN_JSON ON CACHE BOOL "") set(USE_BUNDLED_VALIJSON ON CACHE BOOL "") set(USE_BUNDLED_RE2 ON CACHE BOOL "") set(USE_BUNDLED_UTHASH ON CACHE BOOL "") +if(USE_DYNAMIC_LIBELF) + set(USE_BUNDLED_LIBELF OFF CACHE BOOL "") + set(USE_SHARED_LIBELF ON CACHE BOOL "") +endif() list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules")