Skip to content

Commit 55a25b2

Browse files
authored
cmake: kafka: fix OAuth Bearer detection on Windows
Signed-off-by: BP Cheng <bp_cheng@hotmail.com>
1 parent c06c124 commit 55a25b2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

cmake/kafka.cmake

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,19 @@ else()
2828
endif()
2929
endif()
3030

31-
# OAuth Bearer is built into librdkafka when SASL is available
32-
set(FLB_SASL_OAUTHBEARER_ENABLED ${FLB_SASL_ENABLED})
31+
# OAuth Bearer support:
32+
# - Windows: Built-in SASL, only needs SSL (no Cyrus SASL required)
33+
# - Linux/macOS: Needs both SSL and Cyrus SASL
34+
if(WIN32)
35+
if(WITH_SSL)
36+
set(FLB_SASL_OAUTHBEARER_ENABLED ON)
37+
else()
38+
set(FLB_SASL_OAUTHBEARER_ENABLED OFF)
39+
endif()
40+
else()
41+
# Non-Windows platforms: require Cyrus SASL
42+
set(FLB_SASL_OAUTHBEARER_ENABLED ${FLB_SASL_ENABLED})
43+
endif()
3344

3445
# MSK IAM requires OAuth Bearer support
3546
set(FLB_KAFKA_MSK_IAM_ENABLED ${FLB_SASL_OAUTHBEARER_ENABLED})

0 commit comments

Comments
 (0)