Browse Source

Enabled parallel make

Stefan Schmidt 6 years ago
parent
commit
e28d94fd52
1 changed files with 8 additions and 1 deletions
  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