From 7a2edea7edb2c3f51bcca23d01acfde631a36e72 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Mon, 2 Nov 2020 21:59:13 +0100 Subject: [PATCH] win, build: fix build time on Windows Sets MSBuild experimental switches to make it build in parallel project files generated by gyp 0.5.0. Fixes: https://github.com/nodejs/node/issues/35921 PR-URL: https://github.com/nodejs/node/pull/35932 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Jiawen Geng Reviewed-By: Zeyu Yang Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott --- vcbuild.bat | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcbuild.bat b/vcbuild.bat index 516726a6697f14..86a986b3dec2f3 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -338,6 +338,10 @@ if "%target%"=="Build" ( ) if "%target%"=="node" if exist "%config%\cctest.exe" del "%config%\cctest.exe" if defined msbuild_args set "extra_msbuild_args=%extra_msbuild_args% %msbuild_args%" +@rem Setup env variables to use multiprocessor build +set UseMultiToolTask=True +set EnforceProcessCountAcrossBuilds=True +set MultiProcMaxCount=%NUMBER_OF_PROCESSORS% msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoItemAndPropertyList;Verbosity=minimal /nologo %extra_msbuild_args% if errorlevel 1 ( if not defined project_generated echo Building Node with reused solution failed. To regenerate project files use "vcbuild projgen"