mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-10 11:09:37 +00:00
refactor(build): drop dependencies to chisels, luajit, lyaml, and libyaml
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
@@ -115,9 +115,6 @@ include(ExternalProject)
|
|||||||
# libs
|
# libs
|
||||||
include(falcosecurity-libs)
|
include(falcosecurity-libs)
|
||||||
|
|
||||||
# LuaJit provided by libs
|
|
||||||
include(luajit)
|
|
||||||
|
|
||||||
# jq
|
# jq
|
||||||
include(jq)
|
include(jq)
|
||||||
|
|
||||||
@@ -152,12 +149,6 @@ endif()
|
|||||||
|
|
||||||
include(cxxopts)
|
include(cxxopts)
|
||||||
|
|
||||||
# libyaml
|
|
||||||
include(libyaml)
|
|
||||||
|
|
||||||
# lyaml
|
|
||||||
include(lyaml)
|
|
||||||
|
|
||||||
# One TBB
|
# One TBB
|
||||||
include(tbb)
|
include(tbb)
|
||||||
|
|
||||||
|
@@ -62,14 +62,9 @@ set(LIBSINSP_DIR "${FALCOSECURITY_LIBS_SOURCE_DIR}")
|
|||||||
set(CREATE_TEST_TARGETS OFF CACHE BOOL "")
|
set(CREATE_TEST_TARGETS OFF CACHE BOOL "")
|
||||||
set(BUILD_LIBSCAP_EXAMPLES OFF CACHE BOOL "")
|
set(BUILD_LIBSCAP_EXAMPLES OFF CACHE BOOL "")
|
||||||
|
|
||||||
# todo(leogr): although Falco does not actually depend on chisels, we need this for the lua_parser.
|
|
||||||
# Hopefully, we can switch off this in the future
|
|
||||||
set(WITH_CHISEL ON CACHE BOOL "")
|
|
||||||
|
|
||||||
set(USE_BUNDLED_TBB ON CACHE BOOL "")
|
set(USE_BUNDLED_TBB ON CACHE BOOL "")
|
||||||
set(USE_BUNDLED_B64 ON CACHE BOOL "")
|
set(USE_BUNDLED_B64 ON CACHE BOOL "")
|
||||||
set(USE_BUNDLED_JSONCPP ON CACHE BOOL "")
|
set(USE_BUNDLED_JSONCPP ON CACHE BOOL "")
|
||||||
set(USE_BUNDLED_LUAJIT ON CACHE BOOL "")
|
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules")
|
list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules")
|
||||||
|
|
||||||
|
@@ -1,28 +0,0 @@
|
|||||||
#
|
|
||||||
# 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_ROOT "${PROJECT_BINARY_DIR}/lyaml-prefix/src/lyaml")
|
|
||||||
set(LYAML_LIB "${LYAML_ROOT}/ext/yaml/.libs/yaml.a")
|
|
||||||
set(LYAML_LUA_DIR "${LYAML_ROOT}/lib")
|
|
||||||
message(STATUS "Using bundled lyaml in '${LYAML_ROOT}'")
|
|
||||||
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}
|
|
||||||
INSTALL_COMMAND ""
|
|
||||||
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}
|
|
||||||
)
|
|
@@ -24,37 +24,35 @@ set(FALCO_ENGINE_SOURCE_FILES
|
|||||||
lua_filter_helper.cpp)
|
lua_filter_helper.cpp)
|
||||||
|
|
||||||
add_library(falco_engine STATIC ${FALCO_ENGINE_SOURCE_FILES})
|
add_library(falco_engine STATIC ${FALCO_ENGINE_SOURCE_FILES})
|
||||||
add_dependencies(falco_engine njson lyaml string-view-lite)
|
add_dependencies(falco_engine njson string-view-lite)
|
||||||
|
|
||||||
if(USE_BUNDLED_DEPS)
|
if(USE_BUNDLED_DEPS)
|
||||||
add_dependencies(falco_engine libyaml)
|
add_dependencies(falco_engine yamlcpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MINIMAL_BUILD)
|
if(MINIMAL_BUILD)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
falco_engine
|
falco_engine
|
||||||
PUBLIC
|
PUBLIC
|
||||||
"${LUAJIT_INCLUDE}"
|
|
||||||
"${NJSON_INCLUDE}"
|
"${NJSON_INCLUDE}"
|
||||||
"${TBB_INCLUDE_DIR}"
|
"${TBB_INCLUDE_DIR}"
|
||||||
"${STRING_VIEW_LITE_INCLUDE}"
|
"${STRING_VIEW_LITE_INCLUDE}"
|
||||||
"${LIBSCAP_INCLUDE_DIRS}"
|
"${LIBSCAP_INCLUDE_DIRS}"
|
||||||
"${LIBSINSP_INCLUDE_DIRS}"
|
"${LIBSINSP_INCLUDE_DIRS}"
|
||||||
"${PROJECT_BINARY_DIR}/userspace/engine"
|
"${YAMLCPP_INCLUDE_DIR}"
|
||||||
"${PROJECT_BINARY_DIR}/userspace/engine/lua")
|
"${PROJECT_BINARY_DIR}/userspace/engine")
|
||||||
else()
|
else()
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
falco_engine
|
falco_engine
|
||||||
PUBLIC
|
PUBLIC
|
||||||
"${LUAJIT_INCLUDE}"
|
|
||||||
"${NJSON_INCLUDE}"
|
"${NJSON_INCLUDE}"
|
||||||
"${CURL_INCLUDE_DIR}"
|
"${CURL_INCLUDE_DIR}"
|
||||||
"${TBB_INCLUDE_DIR}"
|
"${TBB_INCLUDE_DIR}"
|
||||||
"${STRING_VIEW_LITE_INCLUDE}"
|
"${STRING_VIEW_LITE_INCLUDE}"
|
||||||
"${LIBSCAP_INCLUDE_DIRS}"
|
"${LIBSCAP_INCLUDE_DIRS}"
|
||||||
"${LIBSINSP_INCLUDE_DIRS}"
|
"${LIBSINSP_INCLUDE_DIRS}"
|
||||||
"${PROJECT_BINARY_DIR}/userspace/engine"
|
"${YAMLCPP_INCLUDE_DIR}"
|
||||||
"${PROJECT_BINARY_DIR}/userspace/engine/lua")
|
"${PROJECT_BINARY_DIR}/userspace/engine")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(falco_engine "${FALCO_SINSP_LIBRARY}" "${LYAML_LIB}" "${LIBYAML_LIB}" luafiles)
|
target_link_libraries(falco_engine "${FALCO_SINSP_LIBRARY}" "${YAMLCPP_LIB}")
|
||||||
|
@@ -1,22 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (C) 2019 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "lua.h"
|
|
||||||
|
|
||||||
int luaopen_yaml (lua_State *L);
|
|
||||||
|
|
@@ -44,10 +44,7 @@ set(
|
|||||||
set(
|
set(
|
||||||
FALCO_DEPENDENCIES
|
FALCO_DEPENDENCIES
|
||||||
string-view-lite
|
string-view-lite
|
||||||
libyaml
|
|
||||||
b64
|
b64
|
||||||
luajit
|
|
||||||
lyaml
|
|
||||||
cxxopts
|
cxxopts
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -55,7 +52,6 @@ set(
|
|||||||
FALCO_LIBRARIES
|
FALCO_LIBRARIES
|
||||||
falco_engine
|
falco_engine
|
||||||
sinsp
|
sinsp
|
||||||
"${LIBYAML_LIB}"
|
|
||||||
"${YAMLCPP_LIB}"
|
"${YAMLCPP_LIB}"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -107,7 +103,6 @@ if(NOT MINIMAL_BUILD)
|
|||||||
"${PROTOBUF_LIB}"
|
"${PROTOBUF_LIB}"
|
||||||
"${CARES_LIB}"
|
"${CARES_LIB}"
|
||||||
"${OPENSSL_LIBRARIES}"
|
"${OPENSSL_LIBRARIES}"
|
||||||
"${LIBYAML_LIB}"
|
|
||||||
"${YAMLCPP_LIB}"
|
"${YAMLCPP_LIB}"
|
||||||
"${CIVETWEB_LIB}"
|
"${CIVETWEB_LIB}"
|
||||||
"${CIVETWEB_CPP_LIB}"
|
"${CIVETWEB_CPP_LIB}"
|
||||||
|
Reference in New Issue
Block a user