From 593c26c08cf84d5f7b9337da4bfc61ae605ffedf Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Tue, 27 Jul 2021 16:20:45 -0700 Subject: [vcpkg] Optionally limit the number of cores during vcpkg bootstrap (#19010) * limit the number of cores during vcpkg bootstrap * Switch to VCPKG_MAX_CONCURRENCY --- scripts/bootstrap.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') 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" -- cgit v1.2.3