summaryrefslogtreecommitdiff
path: root/vcbuild.bat
diff options
context:
space:
mode:
authorJon Kunkee <jkunkee@microsoft.com>2018-12-13 16:43:45 -0800
committerJoão Reis <reis@janeasystems.com>2019-03-04 12:24:09 +0000
commitd57c526cfd822ea55ecb2fecfb804c4a91b5293f (patch)
treef725dc27fade5ad0af673a241db3bd13a1f03123 /vcbuild.bat
parentd3d79d9f86124441763ef28c11667d78cf93af58 (diff)
downloadnode-new-d57c526cfd822ea55ecb2fecfb804c4a91b5293f.tar.gz
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: https://github.com/nodejs/node/pull/25994 Reviewed-By: João Reis <reis@janeasystems.com>
Diffstat (limited to 'vcbuild.bat')
-rw-r--r--vcbuild.bat9
1 files changed, 8 insertions, 1 deletions
diff --git a/vcbuild.bat b/vcbuild.bat
index 9877fb110b..5b09c23c3d 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -1,5 +1,9 @@
@if not defined DEBUG_HELPER @ECHO OFF
+:: Other scripts rely on the environment variables set in this script, so we
+:: explicitly allow them to persist in the calling shell.
+endlocal
+
if /i "%1"=="help" goto help
if /i "%1"=="--help" goto help
if /i "%1"=="-help" goto help
@@ -58,6 +62,7 @@ set no_cctest=
set cctest=
set openssl_no_asm=
set doc=
+set extra_msbuild_args=^
:next-arg
if "%1"=="" goto args-done
@@ -130,6 +135,8 @@ if /i "%1"=="no-cctest" set no_cctest=1&goto arg-ok
if /i "%1"=="cctest" set cctest=1&goto arg-ok
if /i "%1"=="openssl-no-asm" set openssl_no_asm=1&goto arg-ok
if /i "%1"=="doc" set doc=1&goto arg-ok
+if /i "%1"=="binlog" set extra_msbuild_args=%extra_msbuild_args% /binaryLogger:%config%\node.binlog&goto arg-ok
+if /i "%1"=="msbuild_arg" set extra_msbuild_args=%extra_msbuild_args% %2&goto arg-ok-2
echo Error: invalid command line option `%1`.
exit /b 1
@@ -309,7 +316,7 @@ if "%target%"=="Build" (
if defined cctest set target="Build"
)
if "%target%"=="rename_node_bin_win" if exist "%config%\cctest.exe" del "%config%\cctest.exe"
-msbuild node.sln %msbcpu% /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoItemAndPropertyList;Verbosity=minimal /nologo
+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"
goto exit