From 69fffab96630869015437a6d1d13aa1efeb0a9c7 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Mon, 15 Apr 2019 13:39:57 +0900 Subject: [PATCH] out_kafka: make MSVC compatible (#1179) librdkafka is already compatible for MinGW and MSVC. For MSVC, we should avoid to link libpthread. Signed-off-by: Hiroshi Hatake --- cmake/windows-setup.cmake | 2 +- plugins/out_kafka/CMakeLists.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/windows-setup.cmake b/cmake/windows-setup.cmake index 252ff3ba6b6..ba5f14017b0 100644 --- a/cmake/windows-setup.cmake +++ b/cmake/windows-setup.cmake @@ -60,7 +60,7 @@ set(FLB_OUT_STDOUT Yes) set(FLB_OUT_LIB No) set(FLB_OUT_NULL Yes) set(FLB_OUT_FLOWCOUNTER Yes) -set(FLB_OUT_KAFKA No) +set(FLB_OUT_KAFKA Yes) set(FLB_OUT_KAFKA_REST No) # FILTER plugins diff --git a/plugins/out_kafka/CMakeLists.txt b/plugins/out_kafka/CMakeLists.txt index f46bc3971cc..34128cff443 100644 --- a/plugins/out_kafka/CMakeLists.txt +++ b/plugins/out_kafka/CMakeLists.txt @@ -14,4 +14,6 @@ set(src kafka.c) FLB_PLUGIN(out_kafka "${src}" "rdkafka") -target_link_libraries(flb-plugin-out_kafka -lpthread) +if (NOT MSVC) + target_link_libraries(flb-plugin-out_kafka -lpthread) +endif()