Merge PR #31781 into master

* refs/pull/31781/head:
	cmake/modules: look for GNU make first instead of BSD make
	cmake: support parallel build for rocksdb

Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2019-11-25 21:49:31 -06:00
commit cf676c73ab
3 changed files with 16 additions and 3 deletions

View File

@ -1,5 +1,8 @@
function(do_build_dpdk dpdk_dir)
find_program (MAKE_EXECUTABLE NAMES make gmake)
find_program(MAKE_EXECUTABLE NAMES gmake make)
if(NOT MAKE_EXECUTABLE)
message(FATAL_ERROR "Can't find make")
endif()
# mk/machine/native/rte.vars.mk
# rte_cflags are extracted from mk/machine/${machine}/rte.vars.mk
# only 3 of them have -march=<arch> defined, so copying them here.

View File

@ -60,11 +60,18 @@ function(build_rocksdb)
set(rocksdb_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/rocksdb")
set(rocksdb_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/rocksdb")
set(rocksdb_LIBRARY "${rocksdb_BINARY_DIR}/librocksdb.a")
if(CMAKE_MAKE_PROGRAM MATCHES "make")
# try to inherit command line arguments passed by parent "make" job
set(make_cmd $(MAKE) rocksdb)
else()
set(make_cmd ${CMAKE_COMMAND} --build <BINARY_DIR> --target rocksdb)
endif()
ExternalProject_Add(rocksdb_ext
SOURCE_DIR "${rocksdb_SOURCE_DIR}"
CMAKE_ARGS ${rocksdb_CMAKE_ARGS}
BINARY_DIR "${rocksdb_BINARY_DIR}"
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --target rocksdb
BUILD_COMMAND "${make_cmd}"
BUILD_ALWAYS TRUE
BUILD_BYPRODUCTS "${rocksdb_LIBRARY}"
INSTALL_COMMAND "true")

View File

@ -10,7 +10,10 @@ macro(build_spdk)
find_package(uuid REQUIRED)
endif()
find_program (MAKE_EXECUTABLE NAMES make gmake)
find_program(MAKE_EXECUTABLE NAMES gmake make)
if(NOT MAKE_EXECUTABLE)
message(FATAL_ERROR "Can't find make")
endif()
if(CMAKE_MAKE_PROGRAM MATCHES "make")
# try to inherit command line arguments passed by parent "make" job
set(make_cmd "$(MAKE)")