mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-13 20:05:49 +00:00
chore: fix building with njson
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
This commit is contained in:
parent
43c802d045
commit
dca76ba93c
@ -148,16 +148,7 @@ include(falcosecurity-libs)
|
|||||||
include(jq)
|
include(jq)
|
||||||
|
|
||||||
# nlohmann-json
|
# nlohmann-json
|
||||||
set(NJSON_SRC "${PROJECT_BINARY_DIR}/njson-prefix/src/njson")
|
include(njson)
|
||||||
message(STATUS "Using bundled nlohmann-json in '${NJSON_SRC}'")
|
|
||||||
set(NJSON_INCLUDE "${NJSON_SRC}/single_include")
|
|
||||||
ExternalProject_Add(
|
|
||||||
njson
|
|
||||||
URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz"
|
|
||||||
URL_HASH "SHA256=2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801"
|
|
||||||
CONFIGURE_COMMAND ""
|
|
||||||
BUILD_COMMAND ""
|
|
||||||
INSTALL_COMMAND "")
|
|
||||||
|
|
||||||
# b64
|
# b64
|
||||||
include(b64)
|
include(b64)
|
||||||
|
34
cmake/modules/njson.cmake
Normal file
34
cmake/modules/njson.cmake
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2023 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.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# nlohmann-json
|
||||||
|
#
|
||||||
|
if(NJSON_INCLUDE)
|
||||||
|
# Adding the custom target we can use it with `add_dependencies()`
|
||||||
|
if(NOT TARGET njson)
|
||||||
|
add_custom_target(njson)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# We always use the bundled version
|
||||||
|
set(NJSON_SRC "${PROJECT_BINARY_DIR}/njson-prefix/src/njson")
|
||||||
|
set(NJSON_INCLUDE "${NJSON_SRC}/single_include")
|
||||||
|
ExternalProject_Add(
|
||||||
|
njson
|
||||||
|
URL "https://github.com/nlohmann/json/archive/v3.3.0.tar.gz"
|
||||||
|
URL_HASH "SHA256=2fd1d207b4669a7843296c41d3b6ac5b23d00dec48dba507ba051d14564aa801"
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
BUILD_COMMAND ""
|
||||||
|
INSTALL_COMMAND "")
|
||||||
|
message(STATUS "Using bundled nlohmann-json in '${NJSON_SRC}'")
|
||||||
|
endif()
|
@ -19,6 +19,7 @@ if(NOT USE_BUNDLED_DEPS)
|
|||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Couldn't find system yamlcpp")
|
message(FATAL_ERROR "Couldn't find system yamlcpp")
|
||||||
endif()
|
endif()
|
||||||
|
add_custom_target(yamlcpp)
|
||||||
else()
|
else()
|
||||||
set(YAMLCPP_SRC "${PROJECT_BINARY_DIR}/yamlcpp-prefix/src/yamlcpp")
|
set(YAMLCPP_SRC "${PROJECT_BINARY_DIR}/yamlcpp-prefix/src/yamlcpp")
|
||||||
message(STATUS "Using bundled yaml-cpp in '${YAMLCPP_SRC}'")
|
message(STATUS "Using bundled yaml-cpp in '${YAMLCPP_SRC}'")
|
||||||
|
@ -29,9 +29,7 @@ set(FALCO_ENGINE_SOURCE_FILES
|
|||||||
|
|
||||||
add_library(falco_engine STATIC ${FALCO_ENGINE_SOURCE_FILES})
|
add_library(falco_engine STATIC ${FALCO_ENGINE_SOURCE_FILES})
|
||||||
|
|
||||||
if(USE_BUNDLED_DEPS)
|
add_dependencies(falco_engine yamlcpp njson)
|
||||||
add_dependencies(falco_engine yamlcpp njson)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(MINIMAL_BUILD)
|
if(MINIMAL_BUILD)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
|
Loading…
Reference in New Issue
Block a user