mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Added support for optional google-perftools.
This commit is contained in:
parent
5ea4189011
commit
e22ec206ca
5 changed files with 56 additions and 6 deletions
|
@ -36,7 +36,6 @@ set(BROv6 false
|
|||
CACHE STRING "enable IPv6 processing" FORCE)
|
||||
|
||||
# TODO: add to configure wrapper as '--enable-perftools'
|
||||
# TODO: make this option do stuff
|
||||
set(ENABLE_PERFTOOLS false
|
||||
CACHE STRING "use Google's perftools" FORCE)
|
||||
|
||||
|
@ -70,5 +69,5 @@ set(BinPAC_SKIP_INSTALL true)
|
|||
# Uncomment to specify a custom prefix containing the libGeoIP installation.
|
||||
#set(LibGeoIP_ROOT_DIR path/to/your/libGeoIP)
|
||||
|
||||
# TODO: more dependencies:
|
||||
# Google perftools
|
||||
# Uncomment to specify a custom prefix containing Google Perftools installation.
|
||||
#set(GooglePerftools_ROOT_DIR path/to/your/google-perftools)
|
||||
|
|
|
@ -105,7 +105,12 @@ if (LIBGEOIP_FOUND)
|
|||
set(USE_GEOIP true)
|
||||
endif ()
|
||||
|
||||
# TODO: optional Google perftools
|
||||
if (ENABLE_PERFTOOLS)
|
||||
find_package(GooglePerftools)
|
||||
if (GOOGLEPERFTOOLS_FOUND)
|
||||
set(USE_PERFTOOLS true)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
include_directories(BEFORE
|
||||
${PCAP_INCLUDE_DIR}
|
||||
|
@ -115,6 +120,7 @@ include_directories(BEFORE
|
|||
${LibMagic_INCLUDE_DIR}
|
||||
${ZLIB_INCLUDE_DIR}
|
||||
${LibGeoIP_INCLUDE_DIR}
|
||||
${GooglePerftools_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
##
|
||||
|
@ -171,7 +177,7 @@ message(
|
|||
"\nGeoIP: ${USE_GEOIP}"
|
||||
"\nlibz: ${HAVE_LIBZ}"
|
||||
"\nlibmagic: ${HAVE_LIBMAGIC}"
|
||||
"\nGoogle perftools: ${use_perftools}"
|
||||
"\nGoogle perftools: ${USE_PERFTOOLS}"
|
||||
"\n"
|
||||
"\n================================================================\n"
|
||||
)
|
||||
|
|
44
cmake/FindGooglePerftools.cmake
Normal file
44
cmake/FindGooglePerftools.cmake
Normal file
|
@ -0,0 +1,44 @@
|
|||
# - Try to find GooglePerftools headers and libraries
|
||||
#
|
||||
# Usage of this module as follows:
|
||||
#
|
||||
# find_package(GooglePerftools)
|
||||
#
|
||||
# Variables used by this module, they can change the default behaviour and need
|
||||
# to be set before calling find_package:
|
||||
#
|
||||
# GooglePerftools_ROOT_DIR Set this variable to the root installation of
|
||||
# GooglePerftools if the module has problems finding
|
||||
# the proper installation path.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
#
|
||||
# GOOGLEPERFTOOLS_FOUND System has GooglePerftools libs/headers
|
||||
# GooglePerftools_LIBRARIES The GooglePerftools libraries
|
||||
# GooglePerftools_INCLUDE_DIR The location of GooglePerftools headers
|
||||
|
||||
find_path(GooglePerftools_ROOT_DIR
|
||||
NAMES include/google/heap-profiler.h
|
||||
)
|
||||
|
||||
find_library(GooglePerftools_LIBRARIES
|
||||
NAMES tcmalloc
|
||||
HINTS ${GooglePerftools_ROOT_DIR}/lib
|
||||
)
|
||||
|
||||
find_path(GooglePerftools_INCLUDE_DIR
|
||||
NAMES google/heap-profiler.h
|
||||
HINTS ${GooglePerftools_ROOT_DIR}/include
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GooglePerftools DEFAULT_MSG
|
||||
GooglePerftools_LIBRARIES
|
||||
GooglePerftools_INCLUDE_DIR
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
GooglePerftools_ROOT_DIR
|
||||
GooglePerftools_LIBRARIES
|
||||
GooglePerftools_INCLUDE_DIR
|
||||
)
|
|
@ -178,7 +178,7 @@
|
|||
#undef USE_LIBCLAMAV
|
||||
|
||||
/* Use Google's perftools */
|
||||
#undef USE_PERFTOOLS
|
||||
#cmakedefine USE_PERFTOOLS
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "@VERSION@"
|
||||
|
|
|
@ -370,6 +370,7 @@ target_link_libraries(bro
|
|||
${LibMagic_LIBRARY}
|
||||
${ZLIB_LIBRARIES}
|
||||
${LibGeoIP_LIBRARY}
|
||||
${GooglePerftools_LIBRARIES}
|
||||
)
|
||||
|
||||
install(TARGETS bro DESTINATION bin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue