From 612d542ef678be90e9dd490a76c9117b6f569811 Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Sat, 2 Feb 2019 20:47:06 +0600 Subject: [PATCH] Support buld using VS2019 CMake shipped with VS does not support VS2019 yet, so run generator for VS 2017. It will still build using VS 2019 --- src/Native/build.cmd | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Native/build.cmd b/src/Native/build.cmd index 06ebbc2891..1454f47fd0 100644 --- a/src/Native/build.cmd +++ b/src/Native/build.cmd @@ -47,18 +47,30 @@ set "VSCMD_START_DIR=%__currentScriptDir%" call "%_VSCOMNTOOLS%\VsDevCmd.bat" :RunVCVars -if "%VisualStudioVersion%"=="15.0" ( +if "%VisualStudioVersion%"=="16.0" ( + goto :VS2019 +) else if "%VisualStudioVersion%"=="15.0" ( goto :VS2017 ) else if "%VisualStudioVersion%"=="14.0" ( goto :VS2015 ) :MissingVersion -:: Can't find VS 2015 or 2017 -echo Error: Visual Studio 2015 or 2017 required +:: Can't find VS 2015, 2017 or 2019 +echo Error: Visual Studio 2015, 2017 or 2019 required echo Please see https://github.com/dotnet/machinelearning/tree/master/Documentation for build instructions. exit /b 1 +:VS2019 +:: Setup vars for VS2019 +set __PlatformToolset=v142 +set __VSVersion=15 2017 +if NOT "%__BuildArch%" == "arm64" ( + :: Set the environment for the native build + call "%VS160COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch% +) +goto :SetupDirs + :VS2017 :: Setup vars for VS2017 set __PlatformToolset=v141