| 1 | Upstream status: https://github.com/draios/sysdig/pull/2093
|
| 2 |
|
| 3 | diff --git a/cmake/modules/falcosecurity-libs.cmake b/cmake/modules/falcosecurity-libs.cmake
|
| 4 | index 7cee8a3c4..dd59c1b32 100644
|
| 5 | |
| 6 | |
| 7 | @@ -16,6 +16,19 @@
|
| 8 | # limitations under the License.
|
| 9 | #
|
| 10 |
|
| 11 | +option(USE_BUNDLED_FALCOSECURITY_LIBS "Enable building of the bundled falcosecurity libraries" ${USE_BUNDLED_DEPS})
|
| 12 | +
|
| 13 | +if(NOT USE_BUNDLED_FALCOSECURITY_LIBS)
|
| 14 | + find_package(PkgConfig REQUIRED)
|
| 15 | + pkg_check_modules(LIBSINSP REQUIRED IMPORTED_TARGET libsinsp)
|
| 16 | + message(STATUS "Found libsinsp:
|
| 17 | + include: ${LIBSINSP_INCLUDE_DIRS}
|
| 18 | + lib: ${LIBSINSP_LIBRARIES}
|
| 19 | + cflags: ${LIBSINSP_CFLAGS}")
|
| 20 | + return()
|
| 21 | +endif()
|
| 22 | +
|
| 23 | +# else(): using bundled falcosecurity libs
|
| 24 | set(FALCOSECURITY_LIBS_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/falcosecurity-libs-repo")
|
| 25 | set(FALCOSECURITY_LIBS_CMAKE_WORKING_DIR "${CMAKE_BINARY_DIR}/falcosecurity-libs-repo")
|
| 26 |
|
| 27 | diff --git a/userspace/sysdig/CMakeLists.txt b/userspace/sysdig/CMakeLists.txt
|
| 28 | index 60f8072ad..0cb179ccc 100644
|
| 29 | |
| 30 | |
| 31 | @@ -20,7 +20,6 @@ if(NOT WIN32)
|
| 32 | include(ncurses)
|
| 33 | endif() # NOT WIN32
|
| 34 |
|
| 35 | -include(zlib)
|
| 36 | include(luajit)
|
| 37 |
|
| 38 | include_directories("${PROJECT_BINARY_DIR}/userspace/sinspui")
|
| 39 | @@ -84,6 +83,12 @@ if(USE_BUNDLED_DEPS)
|
| 40 | add_dependencies(csysdig luajit)
|
| 41 | endif()
|
| 42 |
|
| 43 | +if(USE_BUNDLED_FALCOSECURITY_LIBS)
|
| 44 | + set(SINSP_LIB sinsp)
|
| 45 | +else()
|
| 46 | + set(SINSP_LIB PkgConfig::LIBSINSP)
|
| 47 | +endif()
|
| 48 | +
|
| 49 | target_include_directories(
|
| 50 | sysdig
|
| 51 | PUBLIC
|
| 52 | @@ -108,7 +113,7 @@ if(NOT WIN32)
|
| 53 | include_directories(${PROJECT_BINARY_DIR}/driver/src)
|
| 54 |
|
| 55 | target_link_libraries(sysdig
|
| 56 | - sinsp
|
| 57 | + "${SINSP_LIB}"
|
| 58 | "${LUAJIT_LIB}"
|
| 59 | "${YAMLCPP_LIB}")
|
| 60 |
|
| 61 | @@ -117,7 +122,7 @@ if(NOT WIN32)
|
| 62 | endif()
|
| 63 |
|
| 64 | target_link_libraries(csysdig
|
| 65 | - sinsp
|
| 66 | + "${SINSP_LIB}"
|
| 67 | "${LUAJIT_LIB}"
|
| 68 | "${CURSES_LIBRARIES}"
|
| 69 | "${YAMLCPP_LIB}")
|
| 70 | @@ -140,12 +145,12 @@ else()
|
| 71 | add_definitions(-DNOCURSESUI)
|
| 72 |
|
| 73 | target_link_libraries(sysdig
|
| 74 | - sinsp
|
| 75 | + "${SINSP_LIB}"
|
| 76 | "${LUAJIT_LIB}"
|
| 77 | "${YAMLCPP_LIB}")
|
| 78 |
|
| 79 | target_link_libraries(csysdig
|
| 80 | - sinsp
|
| 81 | + "${SINSP_LIB}"
|
| 82 | "${LUAJIT_LIB}"
|
| 83 | "${YAMLCPP_LIB}")
|
| 84 |
|