]> granicus.if.org Git - vim/commitdiff
patch 9.0.0528: MS-Windows: no batch files for more recent MSVC versions v9.0.0528
authorK.Takata <kentkt@csc.jp>
Wed, 21 Sep 2022 10:56:41 +0000 (11:56 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 21 Sep 2022 10:56:41 +0000 (11:56 +0100)
Problem:    MS-Windows: no batch files for more recent MSVC versions.
Solution:   Add batch files for 2017, 2019 and 2022. (Ken Takata,
            closes #11184)

Filelist
src/INSTALLpc.txt
src/msvc-latest.bat [new file with mode: 0644]
src/msvc2017.bat [new file with mode: 0644]
src/msvc2019.bat [new file with mode: 0644]
src/msvc2022.bat [new file with mode: 0644]
src/version.c

index 014a801374899d782c736504adb5877c4582ea53..ac936e1b2479583fd5d337aa42cbfb98df77b7a8 100644 (file)
--- a/Filelist
+++ b/Filelist
@@ -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 \
index a73f71894635f821afe595cde0e429fc326c8ad9..9a286447c2ea302f7d4ecda2028b26a437011d29 100644 (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.
 
diff --git a/src/msvc-latest.bat b/src/msvc-latest.bat
new file mode 100644 (file)
index 0000000..4529fa0
--- /dev/null
@@ -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=
diff --git a/src/msvc2017.bat b/src/msvc2017.bat
new file mode 100644 (file)
index 0000000..c7731c9
--- /dev/null
@@ -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=
diff --git a/src/msvc2019.bat b/src/msvc2019.bat
new file mode 100644 (file)
index 0000000..a45ef2c
--- /dev/null
@@ -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=
diff --git a/src/msvc2022.bat b/src/msvc2022.bat
new file mode 100644 (file)
index 0000000..b707410
--- /dev/null
@@ -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=
index 21ff87dc3b9863d6c805545ca0d9abd5ff0826cc..ddb9431f0ba8d3fe603e7e6e44cde74f76a76492 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    528,
 /**/
     527,
 /**/