Skip to content

Commit a762907

Browse files
jkunkeeBethGriggs
authored andcommitted
win,build: add arbitrary and binlog options
This change adds a 'msbuild_arg' option to vcbuild.bat that can be used to pass arbitrary flags to MSBuild. It also adds a 'binlog' flag as a shortcut 'msbuild_arg' option to enable binary logging to `%config%\node.binlog`. This is especially convenient when debugging changes to the build system. In the process of developing this change, the idea of adding 'setlocal' to the beginning of the script was rejected since other scripts in this repo rely on the exported environment variables. This change adds a note describing this. PR-URL: #25994 Reviewed-By: João Reis <[email protected]>
1 parent cc25f22 commit a762907

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vcbuild.bat

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
@if not defined DEBUG_HELPER @ECHO OFF
22

3+
:: Other scripts rely on the environment variables set in this script, so we
4+
:: explicitly allow them to persist in the calling shell.
5+
endlocal
6+
37
if /i "%1"=="help" goto help
48
if /i "%1"=="--help" goto help
59
if /i "%1"=="-help" goto help
@@ -59,6 +63,7 @@ set no_cctest=
5963
set cctest=
6064
set openssl_no_asm=
6165
set doc=
66+
set extra_msbuild_args=^
6267

6368
:next-arg
6469
if "%1"=="" goto args-done
@@ -131,6 +136,8 @@ if /i "%1"=="no-cctest" set no_cctest=1&goto arg-ok
131136
if /i "%1"=="cctest" set cctest=1&goto arg-ok
132137
if /i "%1"=="openssl-no-asm" set openssl_no_asm=1&goto arg-ok
133138
if /i "%1"=="doc" set doc=1&goto arg-ok
139+
if /i "%1"=="binlog" set extra_msbuild_args=%extra_msbuild_args% /binaryLogger:%config%\node.binlog&goto arg-ok
140+
if /i "%1"=="msbuild_arg" set extra_msbuild_args=%extra_msbuild_args% %2&goto arg-ok-2
134141

135142
echo Error: invalid command line option `%1`.
136143
exit /b 1
@@ -310,7 +317,7 @@ if "%target%"=="Build" (
310317
if defined cctest set target="Build"
311318
)
312319
if "%target%"=="rename_node_bin_win" if exist "%config%\cctest.exe" del "%config%\cctest.exe"
313-
msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
320+
msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo %extra_msbuild_args%
314321
if errorlevel 1 (
315322
if not defined project_generated echo Building Node with reused solution failed. To regenerate project files use "vcbuild projgen"
316323
goto exit

0 commit comments

Comments
 (0)