aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBradley Austin Davis <bdavis@saintandreas.org>2021-07-27 16:20:45 -0700
committerGitHub <noreply@github.com>2021-07-27 16:20:45 -0700
commit593c26c08cf84d5f7b9337da4bfc61ae605ffedf (patch)
tree79e0b7b748f82a3382cd3c947b63effb90fd738b /scripts
parentc8441af7e0e7b7522c4d1261ab435385df2a1181 (diff)
downloadvcpkg-593c26c08cf84d5f7b9337da4bfc61ae605ffedf.tar.gz
vcpkg-593c26c08cf84d5f7b9337da4bfc61ae605ffedf.zip
[vcpkg] Optionally limit the number of cores during vcpkg bootstrap (#19010)
* limit the number of cores during vcpkg bootstrap * Switch to VCPKG_MAX_CONCURRENCY
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bootstrap.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 3f5bd85aa..1a17bbfbb 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -299,8 +299,13 @@ echo "Building vcpkg-tool..."
rm -rf "$baseBuildDir"
mkdir -p "$buildDir"
vcpkgExtractArchive "$tarballPath" "$srcBaseDir"
+cmakeConfigOptions="-DCMAKE_BUILD_TYPE=Release -G 'Ninja' -DCMAKE_MAKE_PROGRAM='$ninjaExe'"
-(cd "$buildDir" && CXX="$CXX" "$cmakeExe" "$srcDir" -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1
+if [ "${VCPKG_MAX_CONCURRENCY}" != "" ] ; then
+ cmakeConfigOptions=" $cmakeConfigOptions '-DCMAKE_JOB_POOL_COMPILE:STRING=compile' '-DCMAKE_JOB_POOL_LINK:STRING=link' '-DCMAKE_JOB_POOLS:STRING=compile=$VCPKG_MAX_CONCURRENCY;link=$VCPKG_MAX_CONCURRENCY' "
+fi
+
+(cd "$buildDir" && eval CXX="$CXX" "$cmakeExe" "$srcDir" $cmakeConfigOptions "-DBUILD_TESTING=$vcpkgBuildTests" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1
(cd "$buildDir" && "$cmakeExe" --build .) || exit 1
rm -rf "$vcpkgRootDir/vcpkg"