mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
win: backport set env before generating projects
Backport commit a58b17456a from branch
v0.12.
Original commit message:
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 <jgilli@fastmail.fm>
PR-URL: https://github.com/joyent/node/pull/20109
Conflicts:
vcbuild.bat
Reviewed-By: João Reis <reis@janeasystems.com>
PR-URL: https://github.com/joyent/node/pull/25569
This commit is contained in:
1 parent
7df57703dd
commit
10f251e8dd
1 file changed
+20
-21
+20
-21
@@ -83,25 +83,6 @@ if defined nosnapshot set nosnapshot_arg=--without-snapshot
|
||||
if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
|
||||
if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1
|
||||
|
||||
:project-gen
|
||||
@rem Skip project generation if requested.
|
||||
if defined noprojgen goto msbuild
|
||||
|
||||
if defined NIGHTLY set TAG=nightly-%NIGHTLY%
|
||||
|
||||
@rem Generate the VS project.
|
||||
SETLOCAL
|
||||
if defined VS100COMNTOOLS call "%VS100COMNTOOLS%\VCVarsQueryRegistry.bat"
|
||||
python configure %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG%
|
||||
if errorlevel 1 goto create-msvs-files-failed
|
||||
if not exist node.sln goto create-msvs-files-failed
|
||||
echo Project files generated.
|
||||
ENDLOCAL
|
||||
|
||||
:msbuild
|
||||
@rem Skip project generation if requested.
|
||||
if defined nobuild goto sign
|
||||
|
||||
@rem Look for Visual Studio 2013
|
||||
if not defined VS120COMNTOOLS goto vc-set-2012
|
||||
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
|
||||
@@ -124,13 +105,31 @@ if not defined VS100COMNTOOLS goto msbuild-not-found
|
||||
if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
|
||||
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
|
||||
if not defined VCINSTALLDIR goto msbuild-not-found
|
||||
set GYP_MSVS_VERSION=2010
|
||||
goto msbuild-found
|
||||
|
||||
:msbuild-not-found
|
||||
echo Build skipped. To build, this file needs to run from VS cmd prompt.
|
||||
goto run
|
||||
echo Failed to find Visual Studio installation.
|
||||
goto exit
|
||||
|
||||
:msbuild-found
|
||||
|
||||
:project-gen
|
||||
@rem Skip project generation if requested.
|
||||
if defined noprojgen goto msbuild
|
||||
|
||||
if defined NIGHTLY set TAG=nightly-%NIGHTLY%
|
||||
|
||||
@rem Generate the VS project.
|
||||
python configure %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG%
|
||||
if errorlevel 1 goto create-msvs-files-failed
|
||||
if not exist node.sln goto create-msvs-files-failed
|
||||
echo Project files generated.
|
||||
|
||||
:msbuild
|
||||
@rem Skip project generation if requested.
|
||||
if defined nobuild goto sign
|
||||
|
||||
@rem Build the sln with msbuild.
|
||||
msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
|
||||
if errorlevel 1 goto exit
|
||||
|
||||
Reference in new issue
Block a user