diff options
author | Xenhat Hex | 2022-01-20 19:15:06 -0500 |
---|---|---|
committer | Xenhat Hex | 2022-01-20 20:03:50 -0500 |
commit | 709ef99683d1221871369bb8233e06a089200970 (patch) | |
tree | e2771bb0ea9d37fab4bcfe21ffa3d78d159a8510 | |
parent | 48c9699bffb7553430c68a32b09720c0bf7d47e0 (diff) | |
download | aur-709ef99683d1221871369bb8233e06a089200970.tar.gz |
Add logic to avoid overloading the system when compiling
-rwxr-xr-x | PKGBUILD | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -63,7 +63,14 @@ build() { # shellcheck disable=SC2153 autobuild configure -A 64 -c ReleaseOS -- -DLL_TESTS:BOOL=OFF -DDISABLE_FATAL_WARNINGS=ON -DUSE_LTO:BOOL="$(grep -cq '[^!]lto' <<< "${OPTIONS}" && echo 'ON' || echo 'OFF')" -DVIEWER_CHANNEL="Alchemy Test" cd "build-linux-64" - ninja -j"$(nproc)" + loadavg=$(nproc) + if [[ ${loadavg} -gt 1 ]]; then + if [[ ${loadavg} -le 8 ]]; then loadavg=$((loadavg - 1)) + else + loadavg=$((loadavg - 2)) + fi + fi + time ninja -l${loadavg} } package() { |