@@ -9,25 +9,34 @@ include(FindPkgConfig)
99
1010# Check for libsasl2 (required for SASL authentication)
1111set (FLB_SASL_ENABLED OFF )
12- if (PkgConfig_FOUND)
13- pkg_check_modules(SASL libsasl2)
14- if (SASL_FOUND)
15- message (STATUS "Found libsasl2: ${SASL_VERSION} " )
12+ if ( FLB_SYSTEM_WINDOWS )
13+ # On Windows, we only need TLS support to enable SASL support in librdkafka
14+ if ( NOT FLB_TLS )
15+ message (WARNING "TLS support is required to enable SASL on Windows" )
16+ else ()
1617 set (FLB_SASL_ENABLED ON )
1718 endif ()
1819else ()
19- message (WARNING "pkg-config not available - trying fallback SASL detection" )
20- endif ()
21-
22- # Fallback when pkgconfig is not available or not working properly (centos 6)
23- if (NOT FLB_SASL_ENABLED)
24- find_library (SASL2_LIB NAMES sasl2)
25- find_path (SASL2_INCLUDE NAMES sasl/sasl.h)
26- if (SASL2_LIB AND SASL2_INCLUDE)
27- set (FLB_SASL_ENABLED ON )
28- message (STATUS "Found libsasl2 via fallback: ${SASL2_LIB} " )
20+ if (PkgConfig_FOUND)
21+ pkg_check_modules(SASL libsasl2)
22+ if (SASL_FOUND)
23+ message (STATUS "Found libsasl2: ${SASL_VERSION} " )
24+ set (FLB_SASL_ENABLED ON )
25+ endif ()
2926 else ()
30- message (WARNING "libsasl2 not found - SASL authentication will be disabled" )
27+ message (WARNING "pkg-config not available - trying fallback SASL detection" )
28+ endif ()
29+
30+ # Fallback when pkgconfig is not available or not working properly (centos 6)
31+ if (NOT FLB_SASL_ENABLED)
32+ find_library (SASL2_LIB NAMES sasl2)
33+ find_path (SASL2_INCLUDE NAMES sasl/sasl.h)
34+ if (SASL2_LIB AND SASL2_INCLUDE)
35+ set (FLB_SASL_ENABLED ON )
36+ message (STATUS "Found libsasl2 via fallback: ${SASL2_LIB} " )
37+ else ()
38+ message (WARNING "libsasl2 not found - SASL authentication will be disabled" )
39+ endif ()
3140 endif ()
3241endif ()
3342
@@ -48,14 +57,14 @@ if(FLB_SASL_ENABLED)
4857 FLB_DEFINITION(FLB_HAVE_KAFKA_SASL)
4958 message (STATUS "Kafka SASL authentication: ENABLED" )
5059else ()
51- message (STATUS "Kafka SASL authentication: DISABLED" )
60+ message (FATAL_ERROR "Kafka SASL authentication: DISABLED" )
5261endif ()
5362
5463if (FLB_SASL_OAUTHBEARER_ENABLED)
5564 FLB_DEFINITION(FLB_HAVE_KAFKA_OAUTHBEARER)
5665 message (STATUS "Kafka OAuth Bearer: ENABLED" )
5766else ()
58- message (STATUS "Kafka OAuth Bearer: DISABLED" )
67+ message (FATAL_ERROR "Kafka OAuth Bearer: DISABLED" )
5968endif ()
6069
6170# Disable Curl on macOS (if needed)
0 commit comments