From c51b3c3a17ab976e5be2ef9c0988a4bcf72fb668 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 21 Apr 2022 06:27:25 +0800 Subject: [PATCH] cmake: try to find dml only if PMEM is enabled as the feature dependent on DML library requires PMEM backend. Signed-off-by: Kefu Chai --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42ab137775d73..82d900c6bddd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,11 +212,6 @@ if(WITH_BLUESTORE) # POSIX AIO is integrated into FreeBSD kernel, and exposed by libc. set(HAVE_POSIXAIO ON) endif() - - if(LINUX) - find_package(dml) - set(HAVE_LIBDML ${DML_FOUND}) - endif() endif() # libcryptsetup is only available on linux @@ -243,6 +238,10 @@ CMAKE_DEPENDENT_OPTION(WITH_SYSTEM_LIBURING "Require and build with system libur CMAKE_DEPENDENT_OPTION(WITH_BLUESTORE_PMEM "Enable PMDK libraries" OFF "WITH_BLUESTORE" OFF) +if(WITH_BLUESTORE_PMEM) + find_package(dml) + set(HAVE_LIBDML ${DML_FOUND}) +endif() CMAKE_DEPENDENT_OPTION(WITH_RBD_MIGRATION_FORMAT_QCOW_V1 "Enable librbd QCOW v1 migration format support" ON -- 2.39.5