Fixes to support the Npcap library on Windows

- Ignore conan libpcap if PCAP_ROOT_DIR is passed
- Update the cmake submodule to pick up changes for finding the right
  paths to npcap
- Add lazy-loading of npcap so the library path gets set correctly
  at startup
This commit is contained in:
Tim Wojtulewicz 2022-12-22 13:35:51 -07:00 committed by Tim Wojtulewicz
parent 7c54d1aa1c
commit 58f4ff91d8
5 changed files with 54 additions and 5 deletions

View file

@ -543,6 +543,15 @@ if (ZEEK_STANDALONE)
${bro_SUBDIR_LIBS}
${bro_PLUGIN_LIBS}
)
# npcap/winpcap need to be loaded in delayed mode so that we can set the load path
# correctly at runtime. See https://npcap.com/guide/npcap-devguide.html#npcap-feature-native
# for why this is necessary.
if ( MSVC AND HAVE_WPCAP )
set(zeekdeps ${zeekdeps} delayimp.lib)
set_target_properties(zeek PROPERTIES LINK_FLAGS "/DELAYLOAD:wpcap.dll")
endif()
target_link_libraries(zeek ${bro_PLUGIN_LINK_LIBS} ${zeekdeps} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
# Export symbols from zeek executable for use by plugins