diff --git a/CMakeLists.txt b/CMakeLists.txt index 17edb97e8c..6c3112c527 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -376,9 +376,6 @@ endif () # we have to care about CAF here because Broker headers can pull in CAF # headers. set(zeekdeps ${zeekdeps} ${CAF_LIBRARIES}) -include_directories(BEFORE ${broker_includes} ${CAF_INCLUDE_DIRS}) -include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/auxil/paraglob/include) -include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/auxil/rapidjson/include) include_directories(BEFORE ${PCAP_INCLUDE_DIR} ${BIND_INCLUDE_DIR} @@ -441,9 +438,6 @@ endif () # if one specifies --with-openssl (which may be common). include_directories(BEFORE ${OPENSSL_INCLUDE_DIR}) -# Make everyone find the highwayhash includes -include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/auxil/highwayhash) - # Determine if libfts is external to libc, i.e. musl find_package(FTS) if ( FTS_FOUND ) @@ -451,6 +445,14 @@ if ( FTS_FOUND ) include_directories(BEFORE ${FTS_INCLUDE_DIR}) endif () +# Any headers that are possibly bundled in the Zeek source-tree and that are supposed +# to have priority over any pre-existing/system-wide headers need to appear early in +# compiler search path. +include_directories(BEFORE ${broker_includes} ${CAF_INCLUDE_DIRS}) +include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/auxil/highwayhash) +include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/auxil/paraglob/include) +include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/auxil/rapidjson/include) + set(zeekdeps ${zeekdeps} ${BinPAC_LIBRARY} ${PCAP_LIBRARY}