]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: do not use $(MAKE) in Buildpmem.cmake
authorKefu Chai <kchai@redhat.com>
Thu, 2 Apr 2020 04:15:21 +0000 (12:15 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 3 Apr 2020 05:07:51 +0000 (13:07 +0800)
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>
cmake/modules/Buildpmem.cmake

index 30699283c097106c393c677f7b1fa826bd8f485c..81073271d3508b85df68f6ac9c108057abbdd773 100644 (file)
@@ -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")