summaryrefslogtreecommitdiffstats
path: root/cmake/modules/BuildRocksDB.cmake
diff options
context:
space:
mode:
authorDeepika Upadhyay <dupadhya@redhat.com>2019-11-22 15:17:16 +0100
committerDeepika Upadhyay <dupadhya@redhat.com>2019-11-25 08:44:22 +0100
commita930706aa603ba91800221bba754ee478164108d (patch)
treeea6eb207af1558bea4482e10f9cf9378f6ac6461 /cmake/modules/BuildRocksDB.cmake
parentMerge pull request #31523 from sebastian-philipp/ssh-make-check (diff)
downloadceph-a930706aa603ba91800221bba754ee478164108d.tar.xz
ceph-a930706aa603ba91800221bba754ee478164108d.zip
cmake: support parallel build for rocksdb
* cmake/modules/BuildRocksDB.cmake: if "make" detected use concurrent processing, by passing the jobserver to sub-make using `$(MAKE)` Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
Diffstat (limited to 'cmake/modules/BuildRocksDB.cmake')
-rw-r--r--cmake/modules/BuildRocksDB.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmake/modules/BuildRocksDB.cmake b/cmake/modules/BuildRocksDB.cmake
index 73b864c76a5..f1b68c05422 100644
--- a/cmake/modules/BuildRocksDB.cmake
+++ b/cmake/modules/BuildRocksDB.cmake
@@ -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")