Skip to content

Commit

Permalink
cmake: headers: fix include warnings of disabled/system packages
Browse files Browse the repository at this point in the history
cc1: warning: /home/thomas/external/fluent-bit/lib/<package>/include: No such file or directory [-Wmissing-include-dirs]

If luajit or nghttp2 are found on the system, then the include can be omitted.
If avro is disabled, then the include for jansson can be omitted.

Signed-off-by: Thomas Devoogdt <[email protected]>
  • Loading branch information
ThomasDevoogdt committed Jun 9, 2024
1 parent 36c6f24 commit 169ee05
Showing 1 changed file with 27 additions and 10 deletions.
37 changes: 27 additions & 10 deletions cmake/headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ include_directories(
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CHUNKIO}/include
${CMAKE_CURRENT_BINARY_DIR}/lib/chunkio/include

# LuaJIT
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_LUAJIT}/src
${CMAKE_CURRENT_BINARY_DIR}/lib/luajit-cmake

${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MONKEY}/include
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MONKEY}/include/monkey
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_MBEDTLS}/include
Expand All @@ -36,21 +32,42 @@ include_directories(
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_SNAPPY}
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CMETRICS}/include
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CTRACES}/include
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CARES}/include
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_RING_BUFFER}/lwrb/src/include

${CMAKE_CURRENT_BINARY_DIR}/${FLB_PATH_LIB_CARES}
${CMAKE_CURRENT_BINARY_DIR}/${FLB_PATH_LIB_JANSSON}/include
${CMAKE_CURRENT_BINARY_DIR}/lib/cmetrics
${CMAKE_CURRENT_BINARY_DIR}/include

${CMAKE_CURRENT_BINARY_DIR}/lib/monkey/include/
${CMAKE_CURRENT_BINARY_DIR}/lib/monkey/include/monkey/
)

if(NOT CARES_FOUND)
include_directories(
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_CARES}/include
${CMAKE_CURRENT_BINARY_DIR}/${FLB_PATH_LIB_CARES}
)
endif()

${CMAKE_CURRENT_BINARY_DIR}/lib/nghttp2
${CMAKE_CURRENT_BINARY_DIR}/lib/nghttp2/lib/includes/
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_NGHTTP2}/lib/includes/
if(FLB_AVRO_ENCODER)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/${FLB_PATH_LIB_JANSSON}/include
)
endif()

if(FLB_LUAJIT AND (NOT LUAJIT_FOUND))
include_directories(
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_LUAJIT}/src
${CMAKE_CURRENT_BINARY_DIR}/lib/luajit-cmake
)
endif()

if(NOT NGHTTP2_FOUND)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/lib/nghttp2
${CMAKE_CURRENT_BINARY_DIR}/lib/nghttp2/lib/includes
${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_NGHTTP2}/lib/includes
)
endif()

if(FLB_IN_KAFKA OR FLB_OUT_KAFKA)
include_directories(${FLB_PATH_ROOT_SOURCE}/${FLB_PATH_LIB_RDKAFKA}/src/)
Expand Down

0 comments on commit 169ee05

Please sign in to comment.