mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-08 09:37:58 +00:00
build: cmake modules fixes and split
Signed-off-by: Lorenzo Fontana <fontanalorenz@gmail.com>
This commit is contained in:
parent
8be299939a
commit
e0175b1e06
@ -115,20 +115,8 @@ set(CURSES_NEED_NCURSES TRUE)
|
|||||||
find_package(Curses REQUIRED)
|
find_package(Curses REQUIRED)
|
||||||
message(STATUS "Found ncurses: include: ${CURSES_INCLUDE_DIR}, lib: ${CURSES_LIBRARIES}")
|
message(STATUS "Found ncurses: include: ${CURSES_INCLUDE_DIR}, lib: ${CURSES_LIBRARIES}")
|
||||||
|
|
||||||
# libb64
|
# b64
|
||||||
|
include(b64)
|
||||||
set(B64_SRC "${PROJECT_BINARY_DIR}/b64-prefix/src/b64")
|
|
||||||
message(STATUS "Using bundled b64 in '${B64_SRC}'")
|
|
||||||
set(B64_INCLUDE "${B64_SRC}/include")
|
|
||||||
set(B64_LIB "${B64_SRC}/src/libb64.a")
|
|
||||||
ExternalProject_Add(
|
|
||||||
b64
|
|
||||||
URL "https://github.com/libb64/libb64/archive/ce864b17ea0e24a91e77c7dd3eb2d1ac4175b3f0.tar.gz"
|
|
||||||
URL_HASH "SHA256=d07173e66f435e5c77dbf81bd9313f8d0e4a3b4edd4105a62f4f8132ba932811"
|
|
||||||
CONFIGURE_COMMAND ""
|
|
||||||
BUILD_COMMAND ${CMD_MAKE}
|
|
||||||
BUILD_IN_SOURCE 1
|
|
||||||
INSTALL_COMMAND "")
|
|
||||||
|
|
||||||
# yaml-cpp
|
# yaml-cpp
|
||||||
include(yaml-cpp)
|
include(yaml-cpp)
|
||||||
@ -142,52 +130,16 @@ if(NOT MINIMAL_BUILD)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# LuaJIT
|
# LuaJIT
|
||||||
set(LUAJIT_SRC "${PROJECT_BINARY_DIR}/luajit-prefix/src/luajit/src")
|
include(luajit)
|
||||||
message(STATUS "Using bundled LuaJIT in '${LUAJIT_SRC}'")
|
|
||||||
set(LUAJIT_INCLUDE "${LUAJIT_SRC}")
|
|
||||||
set(LUAJIT_LIB "${LUAJIT_SRC}/libluajit.a")
|
|
||||||
ExternalProject_Add(
|
|
||||||
luajit
|
|
||||||
GIT_REPOSITORY "https://github.com/LuaJIT/LuaJIT"
|
|
||||||
GIT_TAG "1d8b747c161db457e032a023ebbff511f5de5ec2"
|
|
||||||
CONFIGURE_COMMAND ""
|
|
||||||
BUILD_COMMAND ${CMD_MAKE}
|
|
||||||
BUILD_IN_SOURCE 1
|
|
||||||
INSTALL_COMMAND "")
|
|
||||||
|
|
||||||
# Lpeg
|
# Lpeg
|
||||||
set(LPEG_SRC "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg")
|
include(lpeg)
|
||||||
set(LPEG_LIB "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg/build/lpeg.a")
|
|
||||||
message(STATUS "Using bundled lpeg in '${LPEG_SRC}'")
|
|
||||||
set(LPEG_DEPENDENCIES "")
|
|
||||||
list(APPEND LPEG_DEPENDENCIES "luajit")
|
|
||||||
ExternalProject_Add(
|
|
||||||
lpeg
|
|
||||||
DEPENDS ${LPEG_DEPENDENCIES}
|
|
||||||
URL "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz"
|
|
||||||
URL_HASH "SHA256=48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe"
|
|
||||||
BUILD_COMMAND LUA_INCLUDE=${LUAJIT_INCLUDE} "${PROJECT_SOURCE_DIR}/scripts/build-lpeg.sh" "${LPEG_SRC}/build"
|
|
||||||
BUILD_IN_SOURCE 1
|
|
||||||
CONFIGURE_COMMAND ""
|
|
||||||
INSTALL_COMMAND "")
|
|
||||||
|
|
||||||
# libyaml
|
# libyaml
|
||||||
include(libyaml)
|
include(libyaml)
|
||||||
|
|
||||||
# lyaml
|
# lyaml
|
||||||
set(LYAML_SRC "${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml/ext/yaml")
|
include(lyaml)
|
||||||
set(LYAML_LIB "${LYAML_SRC}/.libs/yaml.a")
|
|
||||||
message(STATUS "Using bundled lyaml in '${LYAML_SRC}'")
|
|
||||||
ExternalProject_Add(
|
|
||||||
lyaml
|
|
||||||
DEPENDS luajit libyaml
|
|
||||||
URL "https://github.com/gvvaughan/lyaml/archive/release-v6.0.tar.gz"
|
|
||||||
URL_HASH "SHA256=9d7cf74d776999ff6f758c569d5202ff5da1f303c6f4229d3b41f71cd3a3e7a7"
|
|
||||||
BUILD_COMMAND ${CMD_MAKE}
|
|
||||||
BUILD_IN_SOURCE 1
|
|
||||||
CONFIGURE_COMMAND ./configure --enable-static CFLAGS=-I${LIBYAML_INSTALL_DIR}/include CPPFLAGS=-I${LIBYAML_INSTALL_DIR}/include LDFLAGS=-L${LIBYAML_INSTALL_DIR}/lib LIBS=-lyaml LUA=${LUAJIT_SRC}/luajit LUA_INCLUDE=-I${LUAJIT_INCLUDE}
|
|
||||||
INSTALL_COMMAND sh -c
|
|
||||||
"cp -R ${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml/lib/* ${PROJECT_SOURCE_DIR}/userspace/engine/lua")
|
|
||||||
|
|
||||||
# One TBB
|
# One TBB
|
||||||
set(TBB_SRC "${PROJECT_BINARY_DIR}/tbb-prefix/src/tbb")
|
set(TBB_SRC "${PROJECT_BINARY_DIR}/tbb-prefix/src/tbb")
|
||||||
|
27
cmake/modules/b64.cmake
Normal file
27
cmake/modules/b64.cmake
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020 The Falco Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
|
# the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
set(B64_SRC "${PROJECT_BINARY_DIR}/b64-prefix/src/b64")
|
||||||
|
message(STATUS "Using bundled b64 in '${B64_SRC}'")
|
||||||
|
set(B64_INCLUDE "${B64_SRC}/include")
|
||||||
|
set(B64_LIB "${B64_SRC}/src/libb64.a")
|
||||||
|
externalproject_add(
|
||||||
|
b64
|
||||||
|
URL "https://github.com/libb64/libb64/archive/ce864b17ea0e24a91e77c7dd3eb2d1ac4175b3f0.tar.gz"
|
||||||
|
URL_HASH "SHA256=d07173e66f435e5c77dbf81bd9313f8d0e4a3b4edd4105a62f4f8132ba932811"
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
BUILD_COMMAND ${CMD_MAKE}
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
BUILD_BYPRODUCTS ${B64_LIB}
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
)
|
@ -15,12 +15,13 @@ set(LIBYAML_SRC "${PROJECT_BINARY_DIR}/libyaml-prefix/src/libyaml")
|
|||||||
set(LIBYAML_INSTALL_DIR "${LIBYAML_SRC}/target")
|
set(LIBYAML_INSTALL_DIR "${LIBYAML_SRC}/target")
|
||||||
message(STATUS "Using bundled libyaml in '${LIBYAML_SRC}'")
|
message(STATUS "Using bundled libyaml in '${LIBYAML_SRC}'")
|
||||||
set(LIBYAML_LIB "${LIBYAML_SRC}/src/.libs/libyaml.a")
|
set(LIBYAML_LIB "${LIBYAML_SRC}/src/.libs/libyaml.a")
|
||||||
ExternalProject_Add(
|
externalproject_add(
|
||||||
libyaml
|
libyaml
|
||||||
URL "https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz"
|
URL "https://github.com/yaml/libyaml/releases/download/0.2.5/yaml-0.2.5.tar.gz"
|
||||||
URL_HASH "SHA256=c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4"
|
URL_HASH "SHA256=c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4"
|
||||||
CONFIGURE_COMMAND ./configure --prefix=${LIBYAML_INSTALL_DIR} CFLAGS=-fPIC CPPFLAGS=-fPIC --enable-static=true --enable-shared=false
|
CONFIGURE_COMMAND ./configure --prefix=${LIBYAML_INSTALL_DIR} CFLAGS=-fPIC CPPFLAGS=-fPIC --enable-static=true --enable-shared=false
|
||||||
BUILD_COMMAND ${CMD_MAKE}
|
BUILD_COMMAND ${CMD_MAKE}
|
||||||
BUILD_IN_SOURCE 1
|
BUILD_IN_SOURCE 1
|
||||||
INSTALL_COMMAND ${CMD_MAKE} install)
|
BUILD_BYPRODUCTS ${LIBYAML_LIB}
|
||||||
|
INSTALL_COMMAND ${CMD_MAKE} install
|
||||||
|
)
|
||||||
|
28
cmake/modules/lpeg.cmake
Normal file
28
cmake/modules/lpeg.cmake
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020 The Falco Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
|
# the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
set(LPEG_SRC "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg")
|
||||||
|
set(LPEG_LIB "${PROJECT_BINARY_DIR}/lpeg-prefix/src/lpeg/build/lpeg.a")
|
||||||
|
message(STATUS "Using bundled lpeg in '${LPEG_SRC}'")
|
||||||
|
set(LPEG_DEPENDENCIES "")
|
||||||
|
list(APPEND LPEG_DEPENDENCIES "luajit")
|
||||||
|
ExternalProject_Add(
|
||||||
|
lpeg
|
||||||
|
DEPENDS ${LPEG_DEPENDENCIES}
|
||||||
|
URL "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz"
|
||||||
|
URL_HASH "SHA256=48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe"
|
||||||
|
BUILD_COMMAND LUA_INCLUDE=${LUAJIT_INCLUDE} "${PROJECT_SOURCE_DIR}/scripts/build-lpeg.sh" "${LPEG_SRC}/build"
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
BUILD_BYPRODUCTS ${LPEG_LIB}
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
INSTALL_COMMAND "")
|
27
cmake/modules/luajit.cmake
Normal file
27
cmake/modules/luajit.cmake
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020 The Falco Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
|
# the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
set(LUAJIT_SRC "${PROJECT_BINARY_DIR}/luajit-prefix/src/luajit/src")
|
||||||
|
message(STATUS "Using bundled LuaJIT in '${LUAJIT_SRC}'")
|
||||||
|
set(LUAJIT_INCLUDE "${LUAJIT_SRC}")
|
||||||
|
set(LUAJIT_LIB "${LUAJIT_SRC}/libluajit.a")
|
||||||
|
externalproject_add(
|
||||||
|
luajit
|
||||||
|
GIT_REPOSITORY "https://github.com/LuaJIT/LuaJIT"
|
||||||
|
GIT_TAG "1d8b747c161db457e032a023ebbff511f5de5ec2"
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
BUILD_COMMAND ${CMD_MAKE}
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
BUILD_BYPRODUCTS ${LUAJIT_LIB}
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
)
|
28
cmake/modules/lyaml.cmake
Normal file
28
cmake/modules/lyaml.cmake
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020 The Falco Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
|
# the License. You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
|
||||||
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||||
|
# specific language governing permissions and limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
set(LYAML_SRC "${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml/ext/yaml")
|
||||||
|
set(LYAML_LIB "${LYAML_SRC}/.libs/yaml.a")
|
||||||
|
message(STATUS "Using bundled lyaml in '${LYAML_SRC}'")
|
||||||
|
externalproject_add(
|
||||||
|
lyaml
|
||||||
|
DEPENDS luajit libyaml
|
||||||
|
URL "https://github.com/gvvaughan/lyaml/archive/release-v6.0.tar.gz"
|
||||||
|
URL_HASH "SHA256=9d7cf74d776999ff6f758c569d5202ff5da1f303c6f4229d3b41f71cd3a3e7a7"
|
||||||
|
BUILD_COMMAND ${CMD_MAKE}
|
||||||
|
BUILD_IN_SOURCE 1
|
||||||
|
BUILD_BYPRODUCTS ${LYAML_LIB}
|
||||||
|
CONFIGURE_COMMAND ./configure --enable-static CFLAGS=-I${LIBYAML_INSTALL_DIR}/include CPPFLAGS=-I${LIBYAML_INSTALL_DIR}/include LDFLAGS=-L${LIBYAML_INSTALL_DIR}/lib LIBS=-lyaml LUA=${LUAJIT_SRC}/luajit LUA_INCLUDE=-I${LUAJIT_INCLUDE}
|
||||||
|
INSTALL_COMMAND sh -c
|
||||||
|
"cp -R ${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml/lib/* ${PROJECT_SOURCE_DIR}/userspace/engine/lua"
|
||||||
|
)
|
@ -29,8 +29,8 @@ file(MAKE_DIRECTORY ${SYSDIG_CMAKE_WORKING_DIR})
|
|||||||
# default below In case you want to test against another sysdig version just pass the variable - ie., `cmake
|
# default below In case you want to test against another sysdig version just pass the variable - ie., `cmake
|
||||||
# -DSYSDIG_VERSION=dev ..`
|
# -DSYSDIG_VERSION=dev ..`
|
||||||
if(NOT SYSDIG_VERSION)
|
if(NOT SYSDIG_VERSION)
|
||||||
set(SYSDIG_VERSION "c4f096099bf81966803d26c40c6c2cb2b8d08033")
|
set(SYSDIG_VERSION "fntlnz/sinsp-fixes")
|
||||||
set(SYSDIG_CHECKSUM "SHA256=9bda3960e14a1d9bc71e951b01b11d1885a5a39fd39d89945e99ae5819c8bb15")
|
set(SYSDIG_CHECKSUM "SHA256=30343d50a756cfa1d97939733e3177b6e3f78652555538c3ce4aa4890229d5e5")
|
||||||
endif()
|
endif()
|
||||||
set(PROBE_VERSION "${SYSDIG_VERSION}")
|
set(PROBE_VERSION "${SYSDIG_VERSION}")
|
||||||
|
|
||||||
@ -57,6 +57,7 @@ add_subdirectory("${SYSDIG_SOURCE_DIR}/driver" "${PROJECT_BINARY_DIR}/driver")
|
|||||||
# Add libscap directory
|
# Add libscap directory
|
||||||
add_definitions(-D_GNU_SOURCE)
|
add_definitions(-D_GNU_SOURCE)
|
||||||
add_definitions(-DHAS_CAPTURE)
|
add_definitions(-DHAS_CAPTURE)
|
||||||
|
add_definitions(-DNOCURSESUI)
|
||||||
if(MUSL_OPTIMIZED_BUILD)
|
if(MUSL_OPTIMIZED_BUILD)
|
||||||
add_definitions(-DMUSL_OPTIMIZED)
|
add_definitions(-DMUSL_OPTIMIZED)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2019 The Falco Authors.
|
# Copyright (C) 2020 The Falco Authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||||||
# the License. You may obtain a copy of the License at
|
# the License. You may obtain a copy of the License at
|
||||||
@ -11,6 +11,132 @@
|
|||||||
# specific language governing permissions and limitations under the License.
|
# specific language governing permissions and limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
configure_file(config_falco.h.in config_falco.h)
|
||||||
|
|
||||||
|
set(
|
||||||
|
FALCO_SOURCES
|
||||||
|
configuration.cpp
|
||||||
|
logger.cpp
|
||||||
|
falco_outputs.cpp
|
||||||
|
outputs_file.cpp
|
||||||
|
outputs_program.cpp
|
||||||
|
outputs_stdout.cpp
|
||||||
|
outputs_syslog.cpp
|
||||||
|
event_drops.cpp
|
||||||
|
statsfilewriter.cpp
|
||||||
|
falco.cpp
|
||||||
|
"${SYSDIG_SOURCE_DIR}/userspace/libsinsp/fields_info.cpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(
|
||||||
|
FALCO_INCLUDE_DIRECTORIES
|
||||||
|
"${PROJECT_SOURCE_DIR}/userspace/engine"
|
||||||
|
"${PROJECT_BINARY_DIR}/userspace/falco"
|
||||||
|
"${PROJECT_BINARY_DIR}/driver/src"
|
||||||
|
"${STRING_VIEW_LITE_INCLUDE}"
|
||||||
|
"${YAMLCPP_INCLUDE_DIR}"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
"${DRAIOS_DEPENDENCIES_DIR}/yaml-${DRAIOS_YAML_VERSION}/target/include"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(
|
||||||
|
FALCO_DEPENDENCIES
|
||||||
|
string-view-lite
|
||||||
|
libyaml
|
||||||
|
b64
|
||||||
|
luajit
|
||||||
|
lpeg
|
||||||
|
lyaml
|
||||||
|
)
|
||||||
|
|
||||||
|
set(
|
||||||
|
FALCO_LIBRARIES
|
||||||
|
falco_engine
|
||||||
|
sinsp
|
||||||
|
"${LIBYAML_LIB}"
|
||||||
|
"${YAMLCPP_LIB}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(USE_BUNDLED_DEPS)
|
||||||
|
list(APPEND FALCO_DEPENDENCIES yamlcpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT MINIMAL_BUILD)
|
||||||
|
list(
|
||||||
|
APPEND FALCO_SOURCES
|
||||||
|
webserver.cpp
|
||||||
|
grpc_context.cpp
|
||||||
|
grpc_server_impl.cpp
|
||||||
|
grpc_request_context.cpp
|
||||||
|
grpc_server.cpp
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/version.grpc.pb.cc
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/version.pb.cc
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/outputs.grpc.pb.cc
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/outputs.pb.cc
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/schema.pb.cc
|
||||||
|
)
|
||||||
|
|
||||||
|
list(
|
||||||
|
APPEND FALCO_INCLUDE_DIRECTORIES
|
||||||
|
"${PROJECT_SOURCE_DIR}/userspace/engine"
|
||||||
|
"${PROJECT_BINARY_DIR}/userspace/falco"
|
||||||
|
"${PROJECT_BINARY_DIR}/driver/src"
|
||||||
|
"${STRING_VIEW_LITE_INCLUDE}"
|
||||||
|
"${YAMLCPP_INCLUDE_DIR}"
|
||||||
|
"${CIVETWEB_INCLUDE_DIR}"
|
||||||
|
"${OPENSSL_INCLUDE_DIR}"
|
||||||
|
"${GRPC_INCLUDE}"
|
||||||
|
"${GRPCPP_INCLUDE}"
|
||||||
|
"${PROTOBUF_INCLUDE}"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
|
"${DRAIOS_DEPENDENCIES_DIR}/yaml-${DRAIOS_YAML_VERSION}/target/include"
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND FALCO_DEPENDENCIES civetweb)
|
||||||
|
|
||||||
|
list(
|
||||||
|
APPEND FALCO_LIBRARIES
|
||||||
|
"${GPR_LIB}"
|
||||||
|
"${GRPC_LIB}"
|
||||||
|
"${GRPCPP_LIB}"
|
||||||
|
"${PROTOBUF_LIB}"
|
||||||
|
"${OPENSSL_LIBRARY_SSL}"
|
||||||
|
"${OPENSSL_LIBRARY_CRYPTO}"
|
||||||
|
"${LIBYAML_LIB}"
|
||||||
|
"${YAMLCPP_LIB}"
|
||||||
|
"${CIVETWEB_LIB}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
falco
|
||||||
|
${FALCO_SOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_dependencies(falco ${FALCO_DEPENDENCIES})
|
||||||
|
|
||||||
|
target_link_libraries(
|
||||||
|
falco
|
||||||
|
${FALCO_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
target_include_directories(
|
||||||
|
falco
|
||||||
|
PUBLIC
|
||||||
|
${FALCO_INCLUDE_DIRECTORIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT MINIMAL_BUILD)
|
||||||
|
add_custom_command(
|
||||||
|
TARGET falco
|
||||||
|
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/verify_engine_fields.sh ${CMAKE_SOURCE_DIR}
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
COMMENT "Comparing engine fields checksum in falco_engine.h to actual fields"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
message(STATUS "Skipping engine fields checksum when building the minimal Falco.")
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT MINIMAL_BUILD)
|
if(NOT MINIMAL_BUILD)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT
|
OUTPUT
|
||||||
@ -36,119 +162,8 @@ if(NOT MINIMAL_BUILD)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/schema.proto
|
${CMAKE_CURRENT_SOURCE_DIR}/schema.proto
|
||||||
COMMAND ${PROTOC} -I ${CMAKE_CURRENT_SOURCE_DIR} --grpc_out=. --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN}
|
COMMAND ${PROTOC} -I ${CMAKE_CURRENT_SOURCE_DIR} --grpc_out=. --plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/outputs.proto
|
${CMAKE_CURRENT_SOURCE_DIR}/outputs.proto
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MINIMAL_BUILD)
|
|
||||||
add_executable(
|
|
||||||
falco
|
|
||||||
configuration.cpp
|
|
||||||
logger.cpp
|
|
||||||
falco_outputs.cpp
|
|
||||||
outputs_file.cpp
|
|
||||||
outputs_program.cpp
|
|
||||||
outputs_stdout.cpp
|
|
||||||
outputs_syslog.cpp
|
|
||||||
event_drops.cpp
|
|
||||||
statsfilewriter.cpp
|
|
||||||
falco.cpp
|
|
||||||
"${SYSDIG_SOURCE_DIR}/userspace/libsinsp/fields_info.cpp")
|
|
||||||
else()
|
|
||||||
add_executable(
|
|
||||||
falco
|
|
||||||
configuration.cpp
|
|
||||||
logger.cpp
|
|
||||||
falco_outputs.cpp
|
|
||||||
outputs_file.cpp
|
|
||||||
outputs_grpc.cpp
|
|
||||||
outputs_http.cpp
|
|
||||||
outputs_program.cpp
|
|
||||||
outputs_stdout.cpp
|
|
||||||
outputs_syslog.cpp
|
|
||||||
event_drops.cpp
|
|
||||||
statsfilewriter.cpp
|
|
||||||
falco.cpp
|
|
||||||
"${SYSDIG_SOURCE_DIR}/userspace/libsinsp/fields_info.cpp"
|
|
||||||
webserver.cpp
|
|
||||||
grpc_context.cpp
|
|
||||||
grpc_server_impl.cpp
|
|
||||||
grpc_request_context.cpp
|
|
||||||
grpc_server.cpp
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/version.grpc.pb.cc
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/version.pb.cc
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/outputs.grpc.pb.cc
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/outputs.pb.cc
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/schema.pb.cc)
|
|
||||||
|
|
||||||
add_dependencies(falco civetweb)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_dependencies(falco string-view-lite)
|
|
||||||
|
|
||||||
if(USE_BUNDLED_DEPS)
|
|
||||||
add_dependencies(falco yamlcpp)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MINIMAL_BUILD)
|
|
||||||
target_include_directories(
|
|
||||||
falco
|
|
||||||
PUBLIC
|
|
||||||
"${PROJECT_SOURCE_DIR}/userspace/engine"
|
|
||||||
"${PROJECT_BINARY_DIR}/userspace/falco"
|
|
||||||
"${PROJECT_BINARY_DIR}/driver/src"
|
|
||||||
"${STRING_VIEW_LITE_INCLUDE}"
|
|
||||||
"${YAMLCPP_INCLUDE_DIR}"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
|
||||||
"${DRAIOS_DEPENDENCIES_DIR}/yaml-${DRAIOS_YAML_VERSION}/target/include")
|
|
||||||
|
|
||||||
target_link_libraries(
|
|
||||||
falco
|
|
||||||
falco_engine
|
|
||||||
sinsp
|
|
||||||
"${LIBYAML_LIB}"
|
|
||||||
"${YAMLCPP_LIB}")
|
|
||||||
else()
|
|
||||||
target_include_directories(
|
|
||||||
falco
|
|
||||||
PUBLIC
|
|
||||||
"${PROJECT_SOURCE_DIR}/userspace/engine"
|
|
||||||
"${PROJECT_BINARY_DIR}/userspace/falco"
|
|
||||||
"${PROJECT_BINARY_DIR}/driver/src"
|
|
||||||
"${STRING_VIEW_LITE_INCLUDE}"
|
|
||||||
"${YAMLCPP_INCLUDE_DIR}"
|
|
||||||
"${CIVETWEB_INCLUDE_DIR}"
|
|
||||||
"${OPENSSL_INCLUDE_DIR}"
|
|
||||||
"${GRPC_INCLUDE}"
|
|
||||||
"${GRPCPP_INCLUDE}"
|
|
||||||
"${PROTOBUF_INCLUDE}"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
|
||||||
"${DRAIOS_DEPENDENCIES_DIR}/yaml-${DRAIOS_YAML_VERSION}/target/include")
|
|
||||||
|
|
||||||
target_link_libraries(
|
|
||||||
falco
|
|
||||||
falco_engine
|
|
||||||
sinsp
|
|
||||||
"${GPR_LIB}"
|
|
||||||
"${GRPC_LIB}"
|
|
||||||
"${GRPCPP_LIB}"
|
|
||||||
"${PROTOBUF_LIB}"
|
|
||||||
"${OPENSSL_LIBRARY_SSL}"
|
|
||||||
"${OPENSSL_LIBRARY_CRYPTO}"
|
|
||||||
"${LIBYAML_LIB}"
|
|
||||||
"${YAMLCPP_LIB}"
|
|
||||||
"${CIVETWEB_LIB}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
configure_file(config_falco.h.in config_falco.h)
|
|
||||||
|
|
||||||
if(NOT MINIMAL_BUILD)
|
|
||||||
add_custom_command(
|
|
||||||
TARGET falco
|
|
||||||
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/verify_engine_fields.sh ${CMAKE_SOURCE_DIR}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMENT "Comparing engine fields checksum in falco_engine.h to actual fields")
|
)
|
||||||
else()
|
|
||||||
MESSAGE(STATUS "Skipping engine fields checksum when building the minimal Falco.")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# strip the Falco binary when releasing using musl
|
# strip the Falco binary when releasing using musl
|
||||||
@ -157,7 +172,8 @@ if(MUSL_OPTIMIZED_BUILD AND CMAKE_BUILD_TYPE STREQUAL "release")
|
|||||||
TARGET falco
|
TARGET falco
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_STRIP} --strip-unneeded falco
|
COMMAND ${CMAKE_STRIP} --strip-unneeded falco
|
||||||
COMMENT "Strip the Falco binary when releasing the musl build")
|
COMMENT "Strip the Falco binary when releasing the musl build"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS falco DESTINATION ${FALCO_BIN_DIR})
|
install(TARGETS falco DESTINATION ${FALCO_BIN_DIR})
|
||||||
|
Loading…
Reference in New Issue
Block a user