From 6fca5e7d373ac73328a09d57e01fe1db7d59156b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 2 Apr 2020 12:15:21 +0800 Subject: [PATCH] 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 --- cmake/modules/Buildpmem.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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") -- 2.39.5