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 cdc5b49 commit 95225eb
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 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 @@ -40,17 +36,33 @@ include_directories(
${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(FLB_AVRO_ENCODER)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/${FLB_PATH_LIB_JANSSON}/include
)
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_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 95225eb

Please sign in to comment.