From: Oleksii Shumeiko -X (oshumeik - SOFTSERVE INC at Cisco) Date: Thu, 16 May 2024 17:34:47 +0000 (+0000) Subject: Pull request #4324: Build fixes. X-Git-Tag: 3.2.1.0~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2703f461c915db9ce7a2c59cce8bdbf311f7dd95;p=thirdparty%2Fsnort3.git Pull request #4324: Build fixes. Merge in SNORT/snort3 from ~OSHUMEIK/snort3:platform_fixes to master Squashed commit of the following: commit 56f5a122452e06f4c19d36c7bdd002603a2c0b53 Author: Oleksii Shumeiko Date: Thu May 16 14:37:41 2024 +0300 framework: supply directories to system headers to plug_gen.sh Some GCC verifies actual includes even in '-MM' mode. commit d401dacba1752ba0a85ef9c468b1116fc0a761fa Author: Oleksii Shumeiko Date: Wed May 15 17:26:57 2024 +0300 memory: fix unit test Provide a stub for non-regression-test build. --- diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index e58fb401d..79ee3a9b1 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -60,11 +60,22 @@ add_custom_command( add_custom_target(api_options ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/api_options.h) +list(APPEND inc_local ".") +list(APPEND inc_local "${CMAKE_CURRENT_BINARY_DIR}/..") +list(TRANSFORM inc_local PREPEND "-I") + +list(APPEND inc_external ${EXTERNAL_INCLUDES}) +list(TRANSFORM inc_external PREPEND "-idirafter") + +list(APPEND inc_dirs ${inc_local}) +list(APPEND inc_dirs ${inc_external}) +list(JOIN inc_dirs " " INC_DIRS) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/snort_api.h COMMAND - ${CMAKE_CURRENT_SOURCE_DIR}/plug_gen.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_BINARY_DIR}/snort_api.h + ${CMAKE_CURRENT_SOURCE_DIR}/plug_gen.sh ${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR} ${INC_DIRS} > ${CMAKE_CURRENT_BINARY_DIR}/snort_api.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/plug_gen.sh ${CMAKE_CURRENT_SOURCE_DIR}/plugins.h diff --git a/src/framework/plug_gen.sh b/src/framework/plug_gen.sh index 26203a7f3..bfe0a7e0a 100755 --- a/src/framework/plug_gen.sh +++ b/src/framework/plug_gen.sh @@ -2,7 +2,7 @@ cxx=$1 src=$2 -bin=$3 +dirs=$3 plugs=framework/plugins.h @@ -13,7 +13,7 @@ echo "// this file is generated automatically - do not edit" echo "// see framework/plugins.h for details" echo -$cxx -MM $plugs -I. -I$bin/.. | \ +$cxx -MM $plugs $dirs | \ sed -e "s/ /\n/g" | \ grep ".*.h$" | grep -v "$plugs" | \ sed -e "s/^/#include \"/" -e "s/$/\"/" -e 's/.*api_options.h.*/#include "framework\/api_options.h"/' | \ diff --git a/src/memory/test/memory_cap_test.cc b/src/memory/test/memory_cap_test.cc index 8d26a6ce7..171fe7878 100644 --- a/src/memory/test/memory_cap_test.cc +++ b/src/memory/test/memory_cap_test.cc @@ -64,6 +64,10 @@ unsigned get_instance_id() THREAD_LOCAL const Trace* memory_trace = nullptr; +#ifndef REG_TEST +void Periodic::register_handler(PeriodicHook, void*, uint16_t, uint32_t) { } +#endif + void ModuleManager::accumulate_module(const char*) { } //--------------------------------------------------------------------------