Skip to content

Commit 033a728

Browse files
orangemocharvagg
authored andcommitted
build,win: set env before generating projects
vcbuild.bat calls python configure before setting GYP_MSVS_VERSION, so SelectVisualStudioVersion (tools\gyp\pylib\gyp\MSVSVersion.py) defaults to 'auto' and selects VS 2005. vcbuild sets the environment in the current shell, so this issue would manifest itself only on the first invocation of the script in any given shell windows. Reviewed-By: Julien Gilli <[email protected]> PR-URL: nodejs/node-v0.x-archive#20109
1 parent 6e72ac7 commit 033a728

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

vcbuild.bat

+18-18
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,9 @@ if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu
8484
if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu
8585
if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none
8686

87-
:project-gen
88-
@rem Skip project generation if requested.
89-
if defined noprojgen goto msbuild
90-
9187
if defined NIGHTLY set TAG=nightly-%NIGHTLY%
9288

93-
@rem Generate the VS project.
94-
SETLOCAL
95-
if defined VS100COMNTOOLS call "%VS100COMNTOOLS%\VCVarsQueryRegistry.bat"
96-
python configure %download_arg% %i18n_arg% %debug_arg% %snapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG%
97-
if errorlevel 1 goto create-msvs-files-failed
98-
if not exist node.sln goto create-msvs-files-failed
99-
echo Project files generated.
100-
ENDLOCAL
101-
102-
:msbuild
103-
@rem Skip project generation if requested.
104-
if defined nobuild goto sign
89+
@rem Set environment for msbuild
10590

10691
@rem Look for Visual Studio 2013
10792
if not defined VS120COMNTOOLS goto msbuild-not-found
@@ -115,10 +100,25 @@ set GYP_MSVS_VERSION=2013
115100
goto msbuild-found
116101

117102
:msbuild-not-found
118-
echo Build skipped. To build, this file needs to run from VS cmd prompt.
119-
goto run
103+
echo Failed to find Visual Studio installation.
104+
goto exit
120105

121106
:msbuild-found
107+
108+
:project-gen
109+
@rem Skip project generation if requested.
110+
if defined noprojgen goto msbuild
111+
112+
@rem Generate the VS project.
113+
python configure %download_arg% %i18n_arg% %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG%
114+
if errorlevel 1 goto create-msvs-files-failed
115+
if not exist node.sln goto create-msvs-files-failed
116+
echo Project files generated.
117+
118+
:msbuild
119+
@rem Skip project generation if requested.
120+
if defined nobuild goto sign
121+
122122
@rem Build the sln with msbuild.
123123
msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
124124
if errorlevel 1 goto exit

0 commit comments

Comments
 (0)