Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9835638

Browse files
committed
Added in VS 2022 support
1 parent 510f011 commit 9835638

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs/building/windows-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can build ML.NET either via the command line or by using Visual Studio.
66
## Required Software
77

88
1. **[Visual Studio 2019 Version 16.4+](https://www.visualstudio.com/downloads/) (Community, Professional, Enterprise)** The Community version is completely free. The below build instructions were verified for VS 16.4.
9-
2. **[CMake](https://cmake.org/)** must be installed from [the CMake download page](https://cmake.org/download/#latest) and added to your path.
9+
2. **[CMake](https://cmake.org/)** must be installed from [the CMake download page](https://cmake.org/download/#latest) and added to your path. If you want to use Visual Studio 2022, you need to be using at least CMake 3.21.
1010

1111
### Visual Studio 2019 Installation
1212
We have successfully verified the below build instructions for Visual Studio version 16.4 and higher.

src/Native/build.cmd

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ set "VSCMD_START_DIR=%__currentScriptDir%"
5151
call "%_VSCOMNTOOLS%\VsDevCmd.bat"
5252

5353
:RunVCVars
54-
if "%VisualStudioVersion%"=="16.0" (
54+
if "%VisualStudioVersion%"=="17.0" (
55+
goto :VS2022
56+
) else if "%VisualStudioVersion%"=="16.0" (
5557
goto :VS2019
5658
) else if "%VisualStudioVersion%"=="15.0" (
5759
goto :VS2017
@@ -65,6 +67,14 @@ echo Error: Visual Studio 2015, 2017 or 2019 required
6567
echo Please see https://github.com/dotnet/machinelearning/tree/main/Documentation for build instructions.
6668
exit /b 1
6769

70+
:VS2022
71+
:: Setup vars for VS2019
72+
set __PlatformToolset=v143
73+
set __VSVersion=17 2022
74+
:: Set the environment for the native build
75+
call "%VS170COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch%
76+
77+
goto :SetupDirs
6878
:VS2019
6979
:: Setup vars for VS2019
7080
set __PlatformToolset=v142

0 commit comments

Comments
 (0)