patch 9.0.0528: MS-Windows: no batch files for more recent MSVC versions

Problem:    MS-Windows: no batch files for more recent MSVC versions.
Solution:   Add batch files for 2017, 2019 and 2022. (Ken Takata,
            closes #11184)
This commit is contained in:
K.Takata
2022-09-21 11:56:41 +01:00
committed by Bram Moolenaar
parent 2b1ddf19f8
commit c3430cb583
7 changed files with 123 additions and 1 deletions

View File

@ -538,7 +538,11 @@ SRC_DOS = \
tools/rename.bat \
src/bigvim.bat \
src/bigvim64.bat \
src/msvc-latest.bat \
src/msvc2015.bat \
src/msvc2017.bat \
src/msvc2019.bat \
src/msvc2022.bat \
src/msys32.bat \
src/msys64.bat \
src/dlldata.c \

View File

@ -70,10 +70,15 @@ Visual Studio
Building with Visual Studio (VS2015, VS2017, VS2019 and VS2022) is
straightforward. Older versions probably don't work.
Visual Studio installed a batch file called vcvars32.bat, which you must
Visual Studio installed a batch file called vcvarsall.bat, which you must
run to set up paths for nmake and MSVC. We provide a batch file
"msvc2015.bat" for this. You may need to edit it if you didn't instal Visual
Studio in the standard location.
If you use VS2017 or later, you can use "msvc-latest.bat" (or "msvc2017.bat"
and so on for the specific version). You must specify the architecture (e.g.
"x86", "x64", etc.) as the first argument when you use this. If you use VS2017
Express, you must use "x86_amd64" instead of "x64" for targeting the x64
platform.
To build Vim from the command line with MSVC, use Make_mvc.mak.

72
src/msvc-latest.bat Normal file
View File

@ -0,0 +1,72 @@
@echo off
rem To be used on MS-Windows for Visual C++ 2017 or later.
rem See INSTALLpc.txt for information.
rem
rem Usage:
rem For x86 builds run this with "x86" option:
rem msvc-latest x86
rem For x64 builds run this with "x86_amd64" option or "x64" option:
rem msvc-latest x86_amd64
rem msvc-latest x64
rem
rem Optional environment variables:
rem VSWHERE:
rem Full path to vswhere.exe.
rem VSVEROPT:
rem Option to search specific version of Visual Studio.
rem Default: -latest
rem To search VS2017:
rem set "VSVEROPT=-version [15.0^,16.0^)"
rem To search VS2019:
rem set "VSVEROPT=-version [16.0^,17.0^)"
rem To search VS2022:
rem set "VSVEROPT=-version [17.0^,18.0^)"
if "%VSWHERE%"=="" (
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
set VSWHERE_SET=yes
)
if not exist "%VSWHERE%" (
echo Error: vswhere not found.
set VSWHERE=
set VSWHERE_SET=
exit /b 1
)
if "%VSVEROPT%"=="" (
set VSVEROPT=-latest
set VSVEROPT_SET=yes
)
rem Search Visual Studio Community, Professional or above.
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" %VSVEROPT% -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i
)
if exist "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" (
call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" %*
goto done
)
rem Search Visual Studio 2017 Express.
rem (Visual Studio 2017 Express uses different component IDs.)
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" %VSVEROPT% -products Microsoft.VisualStudio.Product.WDExpress -property installationPath`) do (
set InstallDir=%%i
)
if exist "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" (
call "%InstallDir%\VC\Auxiliary\Build\vcvarsall.bat" %*
) else (
echo Error: vcvarsall.bat not found.
rem Set ERRORLEVEL to 1.
call
)
:done
if "%VSWHERE_SET%"=="yes" (
set VSWHERE=
set VSWHERE_SET=
)
if "%VSVEROPT_SET%"=="yes" (
set VSVEROPT=
set VSVEROPT_SET=
)
set InstallDir=

13
src/msvc2017.bat Normal file
View File

@ -0,0 +1,13 @@
@echo off
rem To be used on MS-Windows for Visual C++ 2017.
rem See INSTALLpc.txt for information.
rem
rem Usage:
rem For x86 builds run this with "x86" option:
rem msvc2017 x86
rem For x64 builds run this with "x86_amd64" option:
rem msvc2017 x86_amd64
set "VSVEROPT=-version [15.0^,16.0^)"
call "%~dp0msvc-latest.bat" %*
set VSVEROPT=

13
src/msvc2019.bat Normal file
View File

@ -0,0 +1,13 @@
@echo off
rem To be used on MS-Windows for Visual C++ 2019.
rem See INSTALLpc.txt for information.
rem
rem Usage:
rem For x86 builds run this with "x86" option:
rem msvc2019 x86
rem For x64 builds run this with "x64" option:
rem msvc2019 x64
set "VSVEROPT=-version [16.0^,17.0^)"
call "%~dp0msvc-latest.bat" %*
set VSVEROPT=

13
src/msvc2022.bat Normal file
View File

@ -0,0 +1,13 @@
@echo off
rem To be used on MS-Windows for Visual C++ 2022.
rem See INSTALLpc.txt for information.
rem
rem Usage:
rem For x86 builds run this with "x86" option:
rem msvc2022 x86
rem For x64 builds run this with "x64" option:
rem msvc2022 x64
set "VSVEROPT=-version [17.0^,18.0^)"
call "%~dp0msvc-latest.bat" %*
set VSVEROPT=

View File

@ -699,6 +699,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
528,
/**/
527,
/**/