Skip to content

Commit 4950f3d

Browse files
committed
build: adjust order for Kafka dependencies and AWS defs
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 72d9dc8 commit 4950f3d

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

CMakeLists.txt

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,38 @@ if(FLB_WASM)
754754
endif ()
755755
endif()
756756

757+
# Kafka support (library in general)
758+
if(FLB_KAFKA)
759+
if(FLB_IN_KAFKA OR FLB_OUT_KAFKA)
760+
if(FLB_PREFER_SYSTEM_LIB_KAFKA)
761+
find_package(PkgConfig)
762+
pkg_check_modules(KAFKA rdkafka>=2.3.0)
763+
endif()
764+
if(KAFKA_FOUND)
765+
include_directories(${KAFKA_INCLUDE_DIRS})
766+
link_directories(${KAFKA_LIBRARY_DIRS})
767+
else()
768+
include(cmake/kafka.cmake)
769+
endif()
770+
endif()
771+
endif()
772+
773+
# AWS MSK IAM detection (must come after Kafka section)
774+
if(FLB_AWS AND FLB_KAFKA)
775+
# Check if Kafka SASL support was detected
776+
if(DEFINED FLB_SASL_ENABLED AND FLB_SASL_ENABLED)
777+
set(FLB_HAVE_AWS_MSK_IAM ON) # Set CMake variable
778+
FLB_DEFINITION(FLB_HAVE_AWS_MSK_IAM) # Set preprocessor definition
779+
message(STATUS "AWS MSK IAM authentication: ENABLED")
780+
else()
781+
message(STATUS "AWS MSK IAM authentication: DISABLED (requires Kafka with libsasl2)")
782+
endif()
783+
else()
784+
if(FLB_AWS AND NOT FLB_KAFKA)
785+
message(STATUS "AWS MSK IAM authentication: DISABLED (requires FLB_KAFKA=ON)")
786+
endif()
787+
endif()
788+
757789
# AWS
758790
if (FLB_AWS)
759791
FLB_DEFINITION(FLB_HAVE_AWS)
@@ -1137,22 +1169,6 @@ if(FLB_BACKTRACE)
11371169
FLB_DEFINITION(FLB_HAVE_LIBBACKTRACE)
11381170
endif()
11391171

1140-
# Kafka support (library in general)
1141-
if(FLB_KAFKA)
1142-
if(FLB_IN_KAFKA OR FLB_OUT_KAFKA)
1143-
if(FLB_PREFER_SYSTEM_LIB_KAFKA)
1144-
find_package(PkgConfig)
1145-
pkg_check_modules(KAFKA rdkafka>=2.3.0)
1146-
endif()
1147-
if(KAFKA_FOUND)
1148-
include_directories(${KAFKA_INCLUDE_DIRS})
1149-
link_directories(${KAFKA_LIBRARY_DIRS})
1150-
else()
1151-
include(cmake/kafka.cmake)
1152-
endif()
1153-
endif()
1154-
endif()
1155-
11561172
# Onigmo (Regex Engine) options
11571173
# =====================
11581174
if(FLB_REGEX)

0 commit comments

Comments
 (0)