summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/monkey/mk_server/CMakeLists.txt
blob: 457525e6253b18fb016dd0621eb89a3f0c041e10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(src
  monkey.c
  mk_lib.c
  mk_fifo.c
  mk_mimetype.c
  mk_vhost.c
  mk_header.c
  mk_config.c
  mk_user.c
  mk_utils.c
  mk_stream.c
  mk_scheduler.c
  mk_http.c
  mk_http_parser.c
  mk_http_thread.c
  mk_socket.c
  mk_net.c
  mk_clock.c
  mk_cache.c
  mk_server.c
  mk_kernel.c
  mk_plugin.c
  )

if(MK_HTTP2)
  set(src
    ${src}
    "mk_http2.c"
    )
endif()

# Always build a static library, thats our core :)
add_library(monkey-core-static STATIC ${src})
set_target_properties(monkey-core-static PROPERTIES OUTPUT_NAME monkey)
target_link_libraries(monkey-core-static mk_core ${CMAKE_THREAD_LIBS_INIT} ${STATIC_PLUGINS_LIBS} ${CMAKE_DL_LIBS} rbtree co)

message(STATUS "LINKING ${STATIC_PLUGINS_LIBS}")

if(NOT DEFINED MK_HAVE_REGEX)
 target_link_libraries(monkey-core-static regex)
endif()

# Linux Kqueue emulation
if(MK_HAVE_LINUX_KQUEUE)
  target_link_libraries(monkey-core-static kqueue)
endif()

# FreeBSD backtrace
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
  target_link_libraries(monkey-core-static execinfo)
endif()

if (CMAKE_SYSTEM_NAME MATCHES "SunOS")
  target_link_libraries(monkey-core-static socket nsl)
endif()