set(HAVE_LIBZFS ${ZFS_FOUND})
endif()
-option(WITH_ZNS "enable zns support" OFF)
-if (WITH_ZNS)
- # TODO: add detection, need kernel header >= 5.5
- set(HAVE_ZNS ON)
-endif()
-
option(WITH_BLUESTORE "Bluestore OSD backend" ON)
if(WITH_BLUESTORE)
if(LINUX)
--- /dev/null
+# Try to find linux/blkzoned.h
+
+find_path(LinuxZNS_INCLUDE_DIR NAMES
+ "linux/blkzoned.h")
+
+find_package_handle_standard_args(LinuxZNS
+ REQUIRED_VARS
+ LinuxZNS_INCLUDE_DIR)
+
+mark_as_advanced(
+ LinuxZNS_INCLUDE_DIR)
+
+if(LinuxZNS_FOUND AND NOT (TARGET Linux::ZNS))
+ add_library(Linux::ZNS INTERFACE IMPORTED)
+ set_target_properties(Linux::ZNS PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${LinuxZNS_INCLUDE_DIR}"
+ INTERFACE_COMPILE_DEFINITIONS HAVE_ZNS=1)
+endif()
${PROJECT_SOURCE_DIR}/src/os/Transaction.cc
)
-if(HAVE_ZNS)
+CMAKE_DEPENDENT_OPTION(WITH_ZNS "enable Linux ZNS support" OFF
+ "CMAKE_SYSTEM_NAME STREQUAL Linux" OFF)
+if(WITH_ZNS)
+ find_package(LinuxZNS REQUIRED)
list(APPEND crimson_seastore_srcs
segment_manager/zns.cc)
endif()
target_link_libraries(crimson-seastore
crimson)
+if(WITH_ZNS)
+ target_link_libraries(crimson-seastore
+ Linux::ZNS)
+endif()
+
set_target_properties(crimson-seastore PROPERTIES
JOB_POOL_COMPILE heavy_compile_job_pool)
/* Define to 1 if you have libxfs */
#cmakedefine HAVE_LIBXFS 1
-/* Define to 1 if zns support enabled */
-#cmakedefine HAVE_ZNS
-
/* SPDK conditional compilation */
#cmakedefine HAVE_SPDK