From 95225eb70010561a57bd85fc70fadbd64359b06d Mon Sep 17 00:00:00 2001 From: Thomas Devoogdt Date: Sun, 9 Jun 2024 13:52:48 +0200 Subject: [PATCH] cmake: headers: fix include warnings of disabled/system packages cc1: warning: /home/thomas/external/fluent-bit/lib//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 --- cmake/headers.cmake | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/cmake/headers.cmake b/cmake/headers.cmake index 45a1394ca7f..7a04c76022b 100755 --- a/cmake/headers.cmake +++ b/cmake/headers.cmake @@ -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 @@ -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/)