Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in VS 2022 support. #5956

Merged
merged 2 commits into from Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/building/windows-instructions.md
Expand Up @@ -6,7 +6,7 @@ You can build ML.NET either via the command line or by using Visual Studio.
## Required Software

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.
2. **[CMake](https://cmake.org/)** must be installed from [the CMake download page](https://cmake.org/download/#latest) and added to your path.
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.

### Visual Studio 2019 Installation
We have successfully verified the below build instructions for Visual Studio version 16.4 and higher.
Expand Down
12 changes: 11 additions & 1 deletion src/Native/build.cmd
Expand Up @@ -51,7 +51,9 @@ set "VSCMD_START_DIR=%__currentScriptDir%"
call "%_VSCOMNTOOLS%\VsDevCmd.bat"

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

:VS2022
:: Setup vars for VS2019
michaelgsharp marked this conversation as resolved.
Show resolved Hide resolved
set __PlatformToolset=v143
set __VSVersion=17 2022
:: Set the environment for the native build
call "%VS170COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch%

goto :SetupDirs
:VS2019
:: Setup vars for VS2019
set __PlatformToolset=v142
Expand Down