From 6c5109776c47b12a02ee2a9f448d311acecac608 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Wed, 25 May 2022 23:08:32 +0800 Subject: [PATCH] fix VS2022 support --- build_env_x64.bat | 7 +++++-- build_env_x86.bat | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build_env_x64.bat b/build_env_x64.bat index 35b701b..aa1cbf2 100755 --- a/build_env_x64.bat +++ b/build_env_x64.bat @@ -3,10 +3,13 @@ cd /d "%~dp0" rem Put in the base path in which Visual Studio is installed, default would be C:\Program Files (x86) set VS_Base_Path=C:\Program Files (x86) +set VS_Base_Path_X64=C:\Program Files +if exist "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2022 if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2019 if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2017 if exist "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" goto vs14 +if exist "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2022_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2019_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto vs2017_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" goto vs2022 @@ -14,7 +17,7 @@ if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Bu if exist ".\sdk_standalone\set_vars64.bat" goto gitlabci :vs2022 -call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" +call "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" goto batend :vs2019 @@ -30,7 +33,7 @@ call "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" goto batend :vs2022_bt -call "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" +call "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" goto batend :vs2019_bt diff --git a/build_env_x86.bat b/build_env_x86.bat index 3307a89..8468f9f 100755 --- a/build_env_x86.bat +++ b/build_env_x86.bat @@ -3,10 +3,13 @@ cd /d "%~dp0" rem Put in the base path in which Visual Studio is installed, default would be C:\Program Files (x86) set VS_Base_Path=C:\Program Files (x86) +set VS_Base_Path_X64=C:\Program Files +if exist "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2022 if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2019 if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2017 if exist "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x86.bat" goto vs14 +if exist "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2022_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2019_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto vs2017_bt if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" goto vs2022 @@ -14,7 +17,7 @@ if exist "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Bu if exist ".\sdk_standalone\set_vars32.bat" goto gitlabci :vs2022 -call "%VS_Base_Path%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" +call "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" goto batend :vs2019 @@ -30,7 +33,7 @@ call "%VS_Base_Path%\Microsoft Visual Studio 14.0\VC\bin\amd64_x86\vcvarsamd64_x goto batend :vs2022_bt -call "%VS_Base_Path%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" +call "%VS_Base_Path_X64%\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars32.bat" goto batend :vs2019_bt