summaryrefslogtreecommitdiffstats
path: root/src/blk/CMakeLists.txt
blob: 288955dd054753e13a32cb7e05ecd98871c47492 (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
58
59
60
61
62
63
64
65
66
67
if(WITH_BLUESTORE OR  WITH_RBD_SSD_CACHE)
list(APPEND libblk_srcs
  BlockDevice.cc)
endif()

if(HAVE_LIBAIO OR HAVE_POSIXAIO)
  list(APPEND libblk_srcs
    kernel/KernelDevice.cc
    kernel/io_uring.cc
    aio/aio.cc)
endif()

if(WITH_BLUESTORE_PMEM)
  list(APPEND libblk_srcs
    pmem/PMEMDevice.cc)
endif()

if(WITH_SPDK)
  list(APPEND libblk_srcs
    spdk/NVMEDevice.cc)
endif()

if(WITH_ZBD)
  list(APPEND libblk_srcs
    zoned/HMSMRDevice.cc)
endif()

if(libblk_srcs)
  add_library(blk STATIC ${libblk_srcs})
  target_include_directories(blk PRIVATE "./")
endif()

if(HAVE_LIBAIO)
  target_link_libraries(blk PUBLIC ${AIO_LIBRARIES} extblkdev)
endif(HAVE_LIBAIO)

if(WITH_SPDK)
  target_link_libraries(blk
    PRIVATE spdk::spdk)
endif()

if(WITH_ZBD)
  target_link_libraries(blk PRIVATE ${ZBD_LIBRARIES})
endif()

if(WITH_BLUESTORE_PMEM)
  if(HAVE_LIBDML)
    target_link_libraries(blk PRIVATE dml::dml dml::dmlhl)
  endif()

  target_link_libraries(blk
    PRIVATE pmdk::pmem)
endif()

if(WITH_EVENTTRACE)
  add_dependencies(blk eventtrace_tp)
endif()

if(WITH_LIBURING)
  if(WITH_SYSTEM_LIBURING)
    find_package(uring REQUIRED)
  else()
    include(Builduring)
    build_uring()
  endif()
  target_link_libraries(blk PRIVATE uring::uring)
endif()