From 169ee05528fe682c978e7232f31ea0109379e6d7 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 | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/cmake/headers.cmake b/cmake/headers.cmake index 45a1394ca7f..fd6aa7aadff 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 @@ -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/)