<commit_before>set(flb_plugins "" CACHE INTERNAL "flb_plugins")

# REGISTER_IN_PLUGIN
macro(REGISTER_IN_PLUGIN name)
  string(FIND ${name} "=" pos)
  if(pos GREATER -1)
    string(REPLACE "=" ";" list ${name})
    list(GET list 0 p_name)
    list(GET list 1 p_path)
    message(STATUS "EXTERNAL IN PLUGIN name='${p_name}' path='${p_path}'")
  else()
    set(p_name ${name})
  endif()

  string(TOUPPER ${p_name} NAME)
  if(FLB_${NAME} OR p_path)
    set(FLB_IN_PLUGINS_DECL "${FLB_IN_PLUGINS_DECL}extern struct flb_input_plugin ${p_name}_plugin;\n")
    set(FLB_IN_PLUGINS_ADD "${FLB_IN_PLUGINS_ADD}    in = &${p_name}_plugin;\n    mk_list_add(&in->_head, &config->in_plugins);\n\n")
    if (p_path)
      add_subdirectory(${p_path} ${p_path})
    else()
      add_subdirectory(${p_name})
    endif()
    set(flb_plugins "${flb_plugins}flb-plugin-${p_name};")
  endif()
endmacro()

# REGISTER_OUT_PLUGIN
macro(REGISTER_OUT_PLUGIN name)
  string(FIND ${name} "=" pos)
  if(pos GREATER -1)
    string(REPLACE "=" ";" list ${name})
    list(GET list 0 p_name)
    list(GET list 1 p_path)
    message(STATUS "EXTERNAL OUT PLUGIN name='${p_name}' path='${p_path}'")
  else()
    set(p_name ${name})
  endif()

  string(TOUPPER ${p_name} NAME)
  if(FLB_${NAME} OR p_path)
    set(FLB_OUT_PLUGINS_DECL "${FLB_OUT_PLUGINS_DECL}extern struct flb_output_plugin ${p_name}_plugin;\n")
    set(FLB_OUT_PLUGINS_ADD "${FLB_OUT_PLUGINS_ADD}    out = &${p_name}_plugin;\n    mk_list_add(&out->_head, &config->out_plugins);\n\n")
    if (p_path)
      add_subdirectory(${p_path} ${p_path})
    else()
      add_subdirectory(${p_name})
    endif()
    set(flb_plugins "${flb_plugins}flb-plugin-${p_name};")
  endif()
endmacro()

# FLB_PLUGIN: used by plugins to perform registration and linking
macro(FLB_PLUGIN name src deps)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
  add_library(flb-plugin-${name} STATIC ${src})
  target_link_libraries(flb-plugin-${name} fluent-bit-static msgpackc-static ${deps})
endmacro()


# ======================
#  Plugins Registration
# ======================

# These plugins works only on Linux
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  REGISTER_IN_PLUGIN("in_cpu")
  REGISTER_IN_PLUGIN("in_mem")
  REGISTER_IN_PLUGIN("in_kmsg")
  REGISTER_IN_PLUGIN("in_tail")
  REGISTER_IN_PLUGIN("in_proc")
endif()

REGISTER_IN_PLUGIN("in_xbee")
REGISTER_IN_PLUGIN("in_head")
REGISTER_IN_PLUGIN("in_health")
REGISTER_IN_PLUGIN("in_http")

if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
  REGISTER_IN_PLUGIN("in_serial")
endif()

REGISTER_IN_PLUGIN("in_stdin")
REGISTER_IN_PLUGIN("in_tcp")
REGISTER_IN_PLUGIN("in_mqtt")
REGISTER_IN_PLUGIN("in_lib")
REGISTER_IN_PLUGIN("in_forward")
REGISTER_IN_PLUGIN("in_random")
REGISTER_OUT_PLUGIN("out_counter")
REGISTER_OUT_PLUGIN("out_es")
REGISTER_OUT_PLUGIN("out_forward")
REGISTER_OUT_PLUGIN("out_http")
REGISTER_OUT_PLUGIN("out_influxdb")
REGISTER_OUT_PLUGIN("out_nats")
REGISTER_OUT_PLUGIN("out_null")
REGISTER_OUT_PLUGIN("out_plot")
REGISTER_OUT_PLUGIN("out_stdout")
REGISTER_OUT_PLUGIN("out_retry")
REGISTER_OUT_PLUGIN("out_td")
REGISTER_OUT_PLUGIN("out_lib")
REGISTER_OUT_PLUGIN("out_flowcounter")

# Register external input and output plugins
if(EXT_IN_PLUGINS)
  string(REPLACE "," ";" plugins ${EXT_IN_PLUGINS})
  foreach(entry ${plugins})
    REGISTER_IN_PLUGIN(${entry})
  endforeach()
endif()
<commit_msg>plugins: do not build out_plot in WIN32<commit_after>set(flb_plugins "" CACHE INTERNAL "flb_plugins")

# REGISTER_IN_PLUGIN
macro(REGISTER_IN_PLUGIN name)
  string(FIND ${name} "=" pos)
  if(pos GREATER -1)
    string(REPLACE "=" ";" list ${name})
    list(GET list 0 p_name)
    list(GET list 1 p_path)
    message(STATUS "EXTERNAL IN PLUGIN name='${p_name}' path='${p_path}'")
  else()
    set(p_name ${name})
  endif()

  string(TOUPPER ${p_name} NAME)
  if(FLB_${NAME} OR p_path)
    set(FLB_IN_PLUGINS_DECL "${FLB_IN_PLUGINS_DECL}extern struct flb_input_plugin ${p_name}_plugin;\n")
    set(FLB_IN_PLUGINS_ADD "${FLB_IN_PLUGINS_ADD}    in = &${p_name}_plugin;\n    mk_list_add(&in->_head, &config->in_plugins);\n\n")
    if (p_path)
      add_subdirectory(${p_path} ${p_path})
    else()
      add_subdirectory(${p_name})
    endif()
    set(flb_plugins "${flb_plugins}flb-plugin-${p_name};")
  endif()
endmacro()

# REGISTER_OUT_PLUGIN
macro(REGISTER_OUT_PLUGIN name)
  string(FIND ${name} "=" pos)
  if(pos GREATER -1)
    string(REPLACE "=" ";" list ${name})
    list(GET list 0 p_name)
    list(GET list 1 p_path)
    message(STATUS "EXTERNAL OUT PLUGIN name='${p_name}' path='${p_path}'")
  else()
    set(p_name ${name})
  endif()

  string(TOUPPER ${p_name} NAME)
  if(FLB_${NAME} OR p_path)
    set(FLB_OUT_PLUGINS_DECL "${FLB_OUT_PLUGINS_DECL}extern struct flb_output_plugin ${p_name}_plugin;\n")
    set(FLB_OUT_PLUGINS_ADD "${FLB_OUT_PLUGINS_ADD}    out = &${p_name}_plugin;\n    mk_list_add(&out->_head, &config->out_plugins);\n\n")
    if (p_path)
      add_subdirectory(${p_path} ${p_path})
    else()
      add_subdirectory(${p_name})
    endif()
    set(flb_plugins "${flb_plugins}flb-plugin-${p_name};")
  endif()
endmacro()

# FLB_PLUGIN: used by plugins to perform registration and linking
macro(FLB_PLUGIN name src deps)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
  add_library(flb-plugin-${name} STATIC ${src})
  target_link_libraries(flb-plugin-${name} fluent-bit-static msgpackc-static ${deps})
endmacro()


# ======================
#  Plugins Registration
# ======================

# These plugins works only on Linux
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  REGISTER_IN_PLUGIN("in_cpu")
  REGISTER_IN_PLUGIN("in_mem")
  REGISTER_IN_PLUGIN("in_kmsg")
  REGISTER_IN_PLUGIN("in_tail")
  REGISTER_IN_PLUGIN("in_proc")
endif()

REGISTER_IN_PLUGIN("in_xbee")
REGISTER_IN_PLUGIN("in_head")
REGISTER_IN_PLUGIN("in_health")
REGISTER_IN_PLUGIN("in_http")

if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
  REGISTER_IN_PLUGIN("in_serial")
endif()

REGISTER_IN_PLUGIN("in_stdin")
REGISTER_IN_PLUGIN("in_tcp")
REGISTER_IN_PLUGIN("in_mqtt")
REGISTER_IN_PLUGIN("in_lib")
REGISTER_IN_PLUGIN("in_forward")
REGISTER_IN_PLUGIN("in_random")
REGISTER_OUT_PLUGIN("out_counter")
REGISTER_OUT_PLUGIN("out_es")
REGISTER_OUT_PLUGIN("out_forward")
REGISTER_OUT_PLUGIN("out_http")
REGISTER_OUT_PLUGIN("out_influxdb")
REGISTER_OUT_PLUGIN("out_nats")
REGISTER_OUT_PLUGIN("out_null")
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
  REGISTER_OUT_PLUGIN("out_plot")
endif()
REGISTER_OUT_PLUGIN("out_stdout")
REGISTER_OUT_PLUGIN("out_retry")
REGISTER_OUT_PLUGIN("out_td")
REGISTER_OUT_PLUGIN("out_lib")
REGISTER_OUT_PLUGIN("out_flowcounter")

# Register external input and output plugins
if(EXT_IN_PLUGINS)
  string(REPLACE "," ";" plugins ${EXT_IN_PLUGINS})
  foreach(entry ${plugins})
    REGISTER_IN_PLUGIN(${entry})
  endforeach()
endif()

{'fraction_non_alphanumeric': 0.15664068245330195, 'fraction_numerical': 0.0020591263421091337, 'mean_word_length': 6.497243660418963, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4083266', 'n_tokens_mistral': 2865, 'n_tokens_neox': 2780, 'n_words': 424}