浏览代码

Merge branch 'parallel_build' of stefan.schmidt/ID2T-toolkit into master

Carlos Garcia 6 年之前
父节点
当前提交
fa0845d26e
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      build.sh

+ 8 - 1
build.sh

@@ -16,8 +16,15 @@ else
 fi
 cmake ..
 
+# Make sure we're able to get the number of cores
+if [ $(uname) = 'Darwin' ]; then
+    NUMCORES=$(sysctl -n hw.logicalcpu)
+else
+    NUMCORES=$(nproc)
+fi
+
 if [ -f Makefile ]; then
-    make
+    make -j$NUMCORES
 else
     echo "Error: 'cmake' did not finish successfully."
     exit