forked from osmocom/wireshark
Falco Bridge: Fix building on Windows.
Fix Falco plugin installation in multi-config environments. Fix FindSinsp on Windows. Ignore a couple of warnings for now.
This commit is contained in:
parent
0f695875ac
commit
52db7e88bc
|
@ -2700,11 +2700,10 @@ if(BUILD_logwolf AND QT_FOUND)
|
|||
endif()
|
||||
|
||||
if (BUILD_logwolf AND SINSP_FOUND)
|
||||
file(MAKE_DIRECTORY ${LOGWOLF_PLUGIN_DIR}/falco)
|
||||
add_custom_target(copy_falco_plugins)
|
||||
add_custom_command(TARGET copy_falco_plugins
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${SINSP_PLUGINS} ${LOGWOLF_PLUGIN_DIR}/falco
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${LOGWOLF_PLUGIN_DIR}/falco
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SINSP_PLUGINS} ${LOGWOLF_PLUGIN_DIR}/falco
|
||||
)
|
||||
add_dependencies(logwolf copy_falco_plugins)
|
||||
endif()
|
||||
|
|
|
@ -39,10 +39,13 @@ find_path(SINSP_PLUGIN_DIR
|
|||
HINTS "${SINSP_PLUGINDIR}"
|
||||
)
|
||||
|
||||
# https://github.com/falcosecurity/libs doesn't yet have any official releases
|
||||
# or tags. Add RelWithDebInfo to our sinsp and scap path suffixes so that we
|
||||
# can find what we need in a local build.
|
||||
find_library(SINSP_LIBRARY
|
||||
NAMES sinsp
|
||||
HINTS "${SINSP_LIBDIR}" "${SINSP_HINTS}/lib"
|
||||
PATH_SUFFIXES libsinsp
|
||||
PATH_SUFFIXES libsinsp libsinsp/RelWithDebInfo
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
|
@ -51,7 +54,7 @@ find_library(SINSP_LIBRARY
|
|||
find_library(SCAP_LIBRARY
|
||||
NAMES scap
|
||||
HINTS "${SINSP_LIBDIR}" "${SINSP_HINTS}/lib"
|
||||
PATH_SUFFIXES libscap
|
||||
PATH_SUFFIXES libscap libscap/RelWithDebInfo
|
||||
PATHS
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
|
@ -60,6 +63,7 @@ find_library(SCAP_LIBRARY
|
|||
find_path(JSON_INCLUDE_DIR
|
||||
NAMES json/json.h
|
||||
HINTS "${SINSP_INCLUDEDIR}" "${SINSP_HINTS}/include"
|
||||
PATH_SUFFIXES userspace/libsinsp/third-party/jsoncpp
|
||||
/usr/include
|
||||
/usr/include/jsoncpp
|
||||
/usr/local/include
|
||||
|
@ -106,19 +110,27 @@ find_package_handle_standard_args(Sinsp
|
|||
REQUIRED_VARS
|
||||
SINSP_LIBRARY SINSP_INCLUDE_DIR
|
||||
SCAP_LIBRARY SCAP_INCLUDE_DIR
|
||||
JSONCPP_LIBRARY JSON_INCLUDE_DIR
|
||||
TBB_LIBRARY TBB_INCLUDE_DIR
|
||||
JSON_INCLUDE_DIR
|
||||
SINSP_PLUGIN_DIR
|
||||
# VERSION_VAR SINSP_VERSION
|
||||
)
|
||||
|
||||
if( SINSP_FOUND )
|
||||
set( SINSP_INCLUDE_DIRS ${SINSP_INCLUDE_DIR} ${SCAP_INCLUDE_DIR} ${JSON_INCLUDE_DIR} ${TBB_INCLUDE_DIR} )
|
||||
set( SINSP_LIBRARIES ${SINSP_LIBRARY} ${SCAP_LIBRARY} ${JSONCPP_LIBRARY} ${TBB_LIBRARY} )
|
||||
set(SINSP_INCLUDE_DIRS ${SINSP_INCLUDE_DIR} ${SCAP_INCLUDE_DIR} ${JSON_INCLUDE_DIR})
|
||||
if(TBB_INCLUDE_DIR)
|
||||
list(APPEND SINSP_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
|
||||
endif()
|
||||
set(SINSP_LIBRARIES ${SINSP_LIBRARY} ${SCAP_LIBRARY})
|
||||
if (JSONCPP_LIBRARY)
|
||||
list(APPEND SINSP_LIBRARIES ${JSONCPP_LIBRARY})
|
||||
endif()
|
||||
if (TBB_LIBRARY)
|
||||
list(APPEND SINSP_LIBRARIES ${TBB_LIBRARY})
|
||||
endif()
|
||||
if (WIN32)
|
||||
set( SINSP_PLUGINS ${SINSP_PLUGIN_DIR}/plugins/cloudtrail/cloudtrail.dll )
|
||||
set(SINSP_PLUGINS ${SINSP_PLUGIN_DIR}/plugins/cloudtrail/cloudtrail.dll)
|
||||
else()
|
||||
set( SINSP_PLUGINS ${SINSP_PLUGIN_DIR}/plugins/cloudtrail/libcloudtrail.so )
|
||||
set(SINSP_PLUGINS ${SINSP_PLUGIN_DIR}/plugins/cloudtrail/libcloudtrail.so)
|
||||
endif()
|
||||
# if (WIN32)
|
||||
# set ( SINSP_DLL_DIR "${SINSP_HINTS}/bin"
|
||||
|
|
|
@ -17,6 +17,12 @@
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4100)
|
||||
#pragma warning(disable:4267)
|
||||
#endif
|
||||
|
||||
// epan/address.h and driver/ppm_events_public.h both define PT_NONE, so
|
||||
// handle libsinsp calls here.
|
||||
|
||||
|
@ -197,3 +203,7 @@ bool extract_sisnp_source_fields(sinsp_source_info_t *ssi, uint32_t evt_num, uin
|
|||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue