瀏覽代碼

Thread limit

Johannes Kreutz 3 年之前
父節點
當前提交
5b99b39568
共有 2 個文件被更改,包括 8 次插入2 次删除
  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