From c0c0d7326938afc689a2b6a59440956b3d054e4d Mon Sep 17 00:00:00 2001 From: Alexis Campailla Date: Thu, 23 Apr 2015 07:26:59 -0700 Subject: [PATCH 1/3] 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 PR-URL: https://github.com/joyent/node/pull/20109 --- vcbuild.bat | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 24431c4058ac80..711cd3a6fb43e1 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -84,24 +84,9 @@ if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none -: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 %download_arg% %i18n_arg% %debug_arg% %snapshot_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 Set environment for msbuild @rem Look for Visual Studio 2013 if not defined VS120COMNTOOLS goto msbuild-not-found @@ -115,10 +100,25 @@ set GYP_MSVS_VERSION=2013 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 + +@rem Generate the VS project. +python configure %download_arg% %i18n_arg% %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 From 4208dc4fef9608acac609d5b4c89abb9e9cb9b11 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Thu, 16 Apr 2015 22:49:49 +1000 Subject: [PATCH 2/3] build: add MSVS 2015 support PR-URL: https://github.com/nodejs/io.js/pull/2036 Reviewed-By: Alexis Campailla --- vcbuild.bat | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vcbuild.bat b/vcbuild.bat index 711cd3a6fb43e1..1009efd7a2559e 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -88,6 +88,18 @@ if defined NIGHTLY set TAG=nightly-%NIGHTLY% @rem Set environment for msbuild +@rem Look for Visual Studio 2015 +if not defined VS140COMNTOOLS goto vc-set-2013 +if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2013 +if "%VCVARS_VER%" NEQ "140" ( + call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" + SET VCVARS_VER=140 +) +if not defined VCINSTALLDIR goto vc-set-2013 +set GYP_MSVS_VERSION=2015 +goto msbuild-found + +:vc-set-2013 @rem Look for Visual Studio 2013 if not defined VS120COMNTOOLS goto msbuild-not-found if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found From c87c34c242ebdfc0c6ab2fac5b18122cf871dd4f Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Tue, 23 Jun 2015 22:13:00 +1000 Subject: [PATCH 3/3] build: fix cherry-pick ooops, fix comment wording PR-URL: https://github.com/nodejs/io.js/pull/2036 Reviewed-By: Alexis Campailla --- vcbuild.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index 1009efd7a2559e..9c6af480edc6ec 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -122,13 +122,13 @@ goto exit if defined noprojgen goto msbuild @rem Generate the VS project. -python configure %download_arg% %i18n_arg% %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% +python configure %download_arg% %i18n_arg% %debug_arg% %snapshot_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. +@rem Skip build if requested. if defined nobuild goto sign @rem Build the sln with msbuild.