summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/chunkio/src/CMakeLists.txt
blob: 9e666381dbf4187258db47a9cbdc38461730f2c3 (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
set(src
  cio_os.c
  cio_log.c
  cio_file.c
  cio_memfs.c
  cio_chunk.c
  cio_meta.c
  cio_scan.c
  cio_utils.c
  cio_stream.c
  cio_stats.c
  cio_error.c
  chunkio.c
  )

set(libs cio-crc32)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  set(src
    ${src}
    cio_file_win32.c
    win32/dirent.c
    )
  set(libs
    ${libs}
    Shell32.lib
    Shlwapi.lib)
else()
  set(src
    ${src}
    cio_file_unix.c
    )
endif()

if(CIO_LIB_STATIC)
  add_library(chunkio-static STATIC ${src})
  target_link_libraries(chunkio-static ${libs})
  if(CIO_SANITIZE_ADDRESS)
    add_sanitizers(chunkio-static)
  endif()
endif()

if (CIO_LIB_SHARED)
  add_library(chunkio-shared SHARED ${src})
  target_link_libraries(chunkio-static ${libs})
  if(CIO_SANITIZE_ADDRESS)
    add_sanitizers(chunkio-shared)
  endif()
endif()

if (NOT CIO_LIB_STATIC AND NOT CIO_LIB_SHARED)
  message(FATAL_ERROR "What are you doing?, you should build something")
endif()