From d994f02d6919e7aab8de7666756838b4e96fa718 Mon Sep 17 00:00:00 2001 From: lixiaoy1 Date: Wed, 10 Jul 2019 11:10:27 -0400 Subject: [PATCH] cmake: update HAVE_PMEM to HAVE_BLUESTORE_PMEM Signed-off-by: Scott Peterson Signed-off-by: Xiaoyan Li --- CMakeLists.txt | 20 ++++++++++---------- src/include/config-h.in.cmake | 4 ++-- src/os/CMakeLists.txt | 8 ++++---- src/os/bluestore/BlockDevice.cc | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffdabda7c80..f2041053b97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -268,6 +268,14 @@ if(WITH_BLUESTORE) endif() endif() +include(CMakeDependentOption) +CMAKE_DEPENDENT_OPTION(WITH_BLUESTORE_PMEM "Enable PMDK libraries" OFF + "WITH_BLUESTORE" OFF) + +if(WITH_BLUESTORE_PMEM) + set(HAVE_BLUESTORE_PMEM ON) +endif() + if(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686|amd64|x86_64|AMD64|aarch64") option(WITH_SPDK "Enable SPDK" ON) else() @@ -282,19 +290,11 @@ if(WITH_SPDK) set(HAVE_SPDK TRUE) endif(WITH_SPDK) -option(WITH_PMEM "Enable PMEM" OFF) -if(WITH_PMEM) - set(HAVE_PMEM ON) - if(NOT WITH_BLUESTORE) - message(SEND_ERROR "Please enable WITH_BLUESTORE for using PMEM") - endif() -endif() - if(WITH_BLUESTORE) - if(NOT AIO_FOUND AND NOT HAVE_POSIXAIO AND NOT WITH_SPDK AND NOT WITH_PMEM) + if(NOT AIO_FOUND AND NOT HAVE_POSIXAIO AND NOT WITH_SPDK AND NOT WITH_BLUESTORE_PMEM) message(SEND_ERROR "WITH_BLUESTORE is ON, " "but none of the bluestore backends is enabled. " - "Please install libaio, or enable WITH_SPDK or WITH_PMEM (experimental)") + "Please install libaio, or enable WITH_SPDK or WITH_BLUESTORE_PMEM (experimental)") endif() endif() diff --git a/src/include/config-h.in.cmake b/src/include/config-h.in.cmake index b1a848d4c10..777f2e06187 100644 --- a/src/include/config-h.in.cmake +++ b/src/include/config-h.in.cmake @@ -111,8 +111,8 @@ /* DPDK conditional compilation */ #cmakedefine HAVE_DPDK -/* PMEM conditional compilation */ -#cmakedefine HAVE_PMEM +/* PMEM_DEVICE (OSD) conditional compilation */ +#cmakedefine HAVE_BLUESTORE_PMEM /* Defined if LevelDB supports bloom filters */ #cmakedefine HAVE_LEVELDB_FILTER_POLICY diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt index e65d7393f7a..2bde97288e5 100644 --- a/src/os/CMakeLists.txt +++ b/src/os/CMakeLists.txt @@ -46,10 +46,10 @@ if(WITH_FUSE) FuseStore.cc) endif(WITH_FUSE) -if(WITH_PMEM) +if(WITH_BLUESTORE_PMEM) list(APPEND libos_srcs bluestore/PMEMDevice.cc) -endif(WITH_PMEM) +endif() if(HAVE_LIBXFS) list(APPEND libos_srcs @@ -121,7 +121,7 @@ if(WITH_BLUESTORE) DESTINATION bin) endif() -if(WITH_PMEM) +if(WITH_BLUESTORE_PMEM) include(ExternalProject) ExternalProject_Add(nvml_ext DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/src/ @@ -145,7 +145,7 @@ if(WITH_PMEM) INTERFACE_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(os pmem) target_include_directories(os SYSTEM PRIVATE "${CMAKE_BINARY_DIR}/src/nvml/src/include") -endif(WITH_PMEM) +endif(WITH_BLUESTORE_PMEM) if(WITH_LTTNG AND WITH_EVENTTRACE) add_dependencies(os eventtrace_tp) diff --git a/src/os/bluestore/BlockDevice.cc b/src/os/bluestore/BlockDevice.cc index bba9a96cd68..ea4170d786c 100644 --- a/src/os/bluestore/BlockDevice.cc +++ b/src/os/bluestore/BlockDevice.cc @@ -27,7 +27,7 @@ #include "NVMEDevice.h" #endif -#if defined(HAVE_PMEM) +#if defined(HAVE_BLUESTORE_PMEM) #include "PMEMDevice.h" #include "libpmem.h" #endif @@ -96,7 +96,7 @@ BlockDevice *BlockDevice::create(CephContext* cct, const string& path, type = "ust-nvme"; } -#if defined(HAVE_PMEM) +#if defined(HAVE_BLUESTORE_PMEM) if (type == "kernel") { int is_pmem = 0; size_t map_len = 0; @@ -115,7 +115,7 @@ BlockDevice *BlockDevice::create(CephContext* cct, const string& path, dout(1) << __func__ << " path " << path << " type " << type << dendl; -#if defined(HAVE_PMEM) +#if defined(HAVE_BLUESTORE_PMEM) if (type == "pmem") { return new PMEMDevice(cct, cb, cbpriv); } -- 2.39.5