summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2020-04-02 06:15:21 +0200
committerKefu Chai <kchai@redhat.com>2020-04-03 07:07:51 +0200
commit6fca5e7d373ac73328a09d57e01fe1db7d59156b (patch)
tree138a606d9f0848bd8c087077ec0098f51756322e /cmake
parentcmake: add find_make() function (diff)
downloadceph-6fca5e7d373ac73328a09d57e01fe1db7d59156b.tar.xz
ceph-6fca5e7d373ac73328a09d57e01fe1db7d59156b.zip
cmake: do not use $(MAKE) in Buildpmem.cmake
we cannot assume that we are using `make` as the cmake generatator, for instance, if ninja is used, `$(MAKE)` won't be substituted by ninja. so we need to check if Make is used as generator, if that's the case, we can just use `$(MAKE)` so we can benefit from the job control of `make`, otherwise, `make` is used, because currently, PMDK uses Makefile to build. Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/Buildpmem.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmake/modules/Buildpmem.cmake b/cmake/modules/Buildpmem.cmake
index 30699283c09..81073271d35 100644
--- a/cmake/modules/Buildpmem.cmake
+++ b/cmake/modules/Buildpmem.cmake
@@ -11,6 +11,9 @@ function(build_pmem)
endif()
set(PMDK_LIB "${PMDK_SRC}/${PMDK_LIB_DIR}")
+ include(FindMake)
+ find_make("MAKE_EXECUTABLE" "make_cmd")
+
ExternalProject_Add(pmdk_ext
GIT_REPOSITORY "https://github.com/ceph/pmdk.git"
GIT_TAG "1.7"
@@ -20,7 +23,7 @@ function(build_pmem)
# build system tests statically linking to librbd (which uses
# libpmemobj) will not link (because we don't build the ndctl
# static library here).
- BUILD_COMMAND $(MAKE) NDCTL_ENABLE=n
+ BUILD_COMMAND ${make_cmd} NDCTL_ENABLE=n
BUILD_IN_SOURCE 1
BUILD_BYPRODUCTS "${PMDK_LIB}/libpmem.a" "${PMDK_LIB}/libpmemobj.a"
INSTALL_COMMAND "true")