Browse Source

Thread limit

Johannes Kreutz 3 years ago
parent
commit
5b99b39568
2 changed files with 8 additions and 2 deletions
  1. 4 1
      trackpoint-app/thirdparty/lib3mf.sh
  2. 4 1
      trackpoint-app/thirdparty/qt.sh

+ 4 - 1
trackpoint-app/thirdparty/lib3mf.sh

@@ -9,6 +9,9 @@ else
   OPTIONS=""
 fi
 
+CORES=$(getconf _NPROCESSORS_ONLN)
+JOBS=$(($CORES-1))
+
 BASEDIR=$PWD/thirdparty/lib3mf
 DEPLOYDIR=$BASEDIR/install
 
@@ -35,7 +38,7 @@ git clone --depth 1 --branch $LIB3MF_TAG $LIB3MF_REPO
 pushd lib3mf
 
 cmake . -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR $CONFIG $OPTIONS
-cmake --build . --parallel
+cmake --build . --parallel $JOBS
 cmake --install .
 
 popd

+ 4 - 1
trackpoint-app/thirdparty/qt.sh

@@ -9,6 +9,9 @@ else
   OPTIONS=""
 fi
 
+CORES=$(getconf _NPROCESSORS_ONLN)
+JOBS=$(($CORES-1))
+
 BASEDIR=$PWD/thirdparty/qt
 DEPLOYDIR=$BASEDIR/install
 
@@ -47,7 +50,7 @@ pushd "qt-everywhere-src-$QT_MAJOR.$QT_MINOR.$QT_BUGFIX"
     -skip qtopcua -skip qtquick3d -skip qtquicktimeline -skip qttools \
     -skip qtdeclarative -skip qtactiveqt
 
-cmake --build . --parallel
+cmake --build . --parallel $JOBS
 cmake --install .
 
 popd