Fix plugin compile problems with highwayhash

The way this is included is still hacky as hell - but now all tests pass.
This commit is contained in:
Johanna Amann 2020-04-24 20:10:05 +00:00
parent 3937fff57f
commit bb050910bb
3 changed files with 20 additions and 20 deletions

View file

@ -370,6 +370,24 @@ include(GetArchitecture)
include(RequireCXX17) include(RequireCXX17)
include(FindKqueue) include(FindKqueue)
########################################################################
## Highwayhash
# Well, this is dirty - but it works. Copy highwayhash over to the build
# directory and build it there using make.
add_custom_target(
libhighwayhash
BYPRODUCTS ${CMAKE_BINARY_DIR}/aux/highwayhash/lib/libhighwayhash.a
DEPENDS ${CMAKE_BINARY_DIR}/aux/highwayhash
COMMAND make
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/aux/highwayhash
)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/aux/highwayhash
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/aux/highwayhash ${CMAKE_BINARY_DIR}/aux/highwayhash)
include_directories(BEFORE ${CMAKE_BINARY_DIR}/aux/highwayhash)
set(zeekdeps ${zeekdeps} ${CMAKE_BINARY_DIR}/aux/highwayhash/lib/libhighwayhash.a)
if ( (OPENSSL_VERSION VERSION_EQUAL "1.1.0") OR (OPENSSL_VERSION VERSION_GREATER "1.1.0") ) if ( (OPENSSL_VERSION VERSION_EQUAL "1.1.0") OR (OPENSSL_VERSION VERSION_GREATER "1.1.0") )
set(ZEEK_HAVE_OPENSSL_1_1 true CACHE INTERNAL "" FORCE) set(ZEEK_HAVE_OPENSSL_1_1 true CACHE INTERNAL "" FORCE)
endif() endif()

2
cmake

@ -1 +1 @@
Subproject commit 861e37c50410b37d08687a691d5868bfff9694dd Subproject commit bad1bc7ec5b64a1fd1ec8ef6886e796ac49121bc

View file

@ -135,24 +135,6 @@ list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}")
binpac_target(binpac_bro-lib.pac) binpac_target(binpac_bro-lib.pac)
list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}") list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}")
########################################################################
## Highwayhash
# Well, this is dirty - but it works. Copy highwayhash over to the build
# directory and build it there using make.
add_custom_target(
libhighwayhash
BYPRODUCTS ${CMAKE_BINARY_DIR}/aux/highwayhash/lib/libhighwayhash.a
DEPENDS ${CMAKE_BINARY_DIR}/aux/highwayhash
COMMAND make
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/aux/highwayhash
)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/aux/highwayhash
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/aux/highwayhash ${CMAKE_BINARY_DIR}/aux/highwayhash)
include_directories(BEFORE ${CMAKE_BINARY_DIR}/aux/highwayhash)
######################################################################## ########################################################################
## Including subdirectories. ## Including subdirectories.
######################################################################## ########################################################################
@ -356,7 +338,7 @@ set(bro_SRCS
collect_headers(bro_HEADERS ${bro_SRCS}) collect_headers(bro_HEADERS ${bro_SRCS})
add_executable(zeek ${bro_SRCS} ${bro_HEADERS} ${bro_SUBDIR_LIBS} ${bro_PLUGIN_LIBS}) add_executable(zeek ${bro_SRCS} ${bro_HEADERS} ${bro_SUBDIR_LIBS} ${bro_PLUGIN_LIBS})
target_link_libraries(zeek ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${CMAKE_BINARY_DIR}/aux/highwayhash/lib/libhighwayhash.a) target_link_libraries(zeek ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
if ( NOT "${bro_LINKER_FLAGS}" STREQUAL "" ) if ( NOT "${bro_LINKER_FLAGS}" STREQUAL "" )
set_target_properties(zeek PROPERTIES LINK_FLAGS "${bro_LINKER_FLAGS}") set_target_properties(zeek PROPERTIES LINK_FLAGS "${bro_LINKER_FLAGS}")