]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
do_cmake: add a default value to BOOST_J 38699/head
authorluo rixin <luorixin@huawei.com>
Wed, 23 Dec 2020 08:37:12 +0000 (16:37 +0800)
committerluo rixin <luorixin@huawei.com>
Wed, 23 Dec 2020 09:11:29 +0000 (17:11 +0800)
Signed-off-by: luo rixin <luorixin@huawei.com>
do_cmake.sh

index d70aff8601079ba46f33e9fe598bb1e0713d0fb7..345986d630c7c5f0a6c0d3bc0c473c7be260c710 100755 (executable)
@@ -53,6 +53,11 @@ if type ccache > /dev/null 2>&1 ; then
     ARGS+=" -DWITH_CCACHE=ON"
 fi
 
+if [[ ! "$ARGS $@" =~ "-DBOOST_J" ]] ; then
+    ncpu=$(getconf _NPROCESSORS_ONLN 2>&1)
+    [ -n "$ncpu" -a "$ncpu" -gt 1 ] && ARGS+=" -DBOOST_J=$(expr $ncpu / 2)"
+fi
+
 mkdir $BUILD_DIR
 cd $BUILD_DIR
 if type cmake3 > /dev/null 2>&1 ; then