From 745fbf81fdee5d76f1dc140aec0365b229bebe1c Mon Sep 17 00:00:00 2001 From: oOtroyOo <497790325@qq.com> Date: Fri, 19 Apr 2024 11:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=86=E5=88=AB=E5=AE=89=E8=A3=85=E7=9A=84VS?= =?UTF-8?q?=E7=89=88=E6=9C=AC=20(#1124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/luac/make_win32.bat | 23 +++++++++++++++++++++-- build/luac/make_win64.bat | 23 +++++++++++++++++++++-- build/make_win32_lua53.bat | 21 ++++++++++++++++++++- build/make_win64_lua53.bat | 21 ++++++++++++++++++++- build/make_win_lua54.bat | 25 +++++++++++++++++++++++-- 5 files changed, 105 insertions(+), 8 deletions(-) diff --git a/build/luac/make_win32.bat b/build/luac/make_win32.bat index 91d20f81d..9a015b4dd 100644 --- a/build/luac/make_win32.bat +++ b/build/luac/make_win32.bat @@ -1,6 +1,25 @@ + +set "__VS=Visual Studio 16 2019" +set "__VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set "__VSDISPLAY=" +set "__VSVER=" +if exist "%__VSWhere%" ( + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productLineVersion' + ) do set __VSDISPLAY=%%p + + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productDisplayVersion' + ) do set __VSVER=%%p + +) +if "%__VSVER%" neq "" ( + set __VS=Visual Studio %__VSVER:~0,2% %__VSDisplay% +) + mkdir build32 & pushd build32 -cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "Visual Studio 14 2015" .. -IF %ERRORLEVEL% NEQ 0 cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "Visual Studio 15 2017" .. +cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "%__VS%" -A Win32 .. +IF %ERRORLEVEL% NEQ 0 cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "Visual Studio 16 2019" -A Win32 .. popd cmake --build build32 --config Release pause \ No newline at end of file diff --git a/build/luac/make_win64.bat b/build/luac/make_win64.bat index f3da7fb8b..e9b3160a4 100644 --- a/build/luac/make_win64.bat +++ b/build/luac/make_win64.bat @@ -1,6 +1,25 @@ + +set "__VS=Visual Studio 16 2019" +set "__VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set "__VSDISPLAY=" +set "__VSVER=" +if exist "%__VSWhere%" ( + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productLineVersion' + ) do set __VSDISPLAY=%%p + + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productDisplayVersion' + ) do set __VSVER=%%p + +) +if "%__VSVER%" neq "" ( + set __VS=Visual Studio %__VSVER:~0,2% %__VSDisplay% +) + mkdir build64 & pushd build64 -cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "Visual Studio 14 2015 Win64" .. -IF %ERRORLEVEL% NEQ 0 cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "Visual Studio 15 2017 Win64" .. +cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "%__VS%" -A x64 .. +IF %ERRORLEVEL% NEQ 0 cmake -DLUAC_COMPATIBLE_FORMAT=ON -G "Visual Studio 16 2019" -A x64 .. popd cmake --build build64 --config Release pause \ No newline at end of file diff --git a/build/make_win32_lua53.bat b/build/make_win32_lua53.bat index e5211e067..0cf393d4d 100644 --- a/build/make_win32_lua53.bat +++ b/build/make_win32_lua53.bat @@ -1,5 +1,24 @@ + +set "__VS=Visual Studio 16 2019" +set "__VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set "__VSDISPLAY=" +set "__VSVER=" +if exist "%__VSWhere%" ( + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productLineVersion' + ) do set __VSDISPLAY=%%p + + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productDisplayVersion' + ) do set __VSVER=%%p + +) +if "%__VSVER%" neq "" ( + set __VS=Visual Studio %__VSVER:~0,2% %__VSDisplay% +) + mkdir build32 & pushd build32 -cmake -G "Visual Studio 16 2019" -A Win32 .. +cmake -G "%__VS%" -A Win32 .. popd cmake --build build32 --config Release md plugin_lua53\Plugins\x86 diff --git a/build/make_win64_lua53.bat b/build/make_win64_lua53.bat index 6ffd9f658..e3e338ae4 100644 --- a/build/make_win64_lua53.bat +++ b/build/make_win64_lua53.bat @@ -1,5 +1,24 @@ + +set "__VS=Visual Studio 16 2019" +set "__VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set "__VSDISPLAY=" +set "__VSVER=" +if exist "%__VSWhere%" ( + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productLineVersion' + ) do set __VSDISPLAY=%%p + + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productDisplayVersion' + ) do set __VSVER=%%p + +) +if "%__VSVER%" neq "" ( + set __VS=Visual Studio %__VSVER:~0,2% %__VSDisplay% +) + mkdir build64 & pushd build64 -cmake -G "Visual Studio 16 2019" -A x64 .. +cmake -G "%__VS%" -A x64 .. popd cmake --build build64 --config Release md plugin_lua53\Plugins\x86_64 diff --git a/build/make_win_lua54.bat b/build/make_win_lua54.bat index 629385ada..6b0c85ebd 100644 --- a/build/make_win_lua54.bat +++ b/build/make_win_lua54.bat @@ -1,12 +1,33 @@ + +set "__VS=Visual Studio 16 2019" +set "__VSWhere=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +set "__VSDISPLAY=" +set "__VSVER=" + +if exist "%__VSWhere%" ( + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productLineVersion' + ) do set __VSDISPLAY=%%p + + for /f "tokens=*" %%p in ( + '"%__VSWhere%" -latest -property catalog_productDisplayVersion' + ) do set __VSVER=%%p +) + +if "%__VSVER%" neq "" ( + set __VS=Visual Studio %__VSVER:~0,2% %__VSDisplay% +) + + mkdir build64_54 & pushd build64_54 -cmake -DLUA_VERSION=5.4.1 -G "Visual Studio 16 2019" -A x64 .. +cmake -DLUA_VERSION=5.4.1 -G "%__VS%" -A x64 .. popd cmake --build build64_54 --config Release md plugin_lua54\Plugins\x86_64 copy /Y build64_54\Release\xlua.dll plugin_lua54\Plugins\x86_64\xlua.dll mkdir build32_54 & pushd build32_54 -cmake -DLUA_VERSION=5.4.1 -G "Visual Studio 16 2019" -A Win32 .. +cmake -DLUA_VERSION=5.4.1 -G "%__VS%" -A Win32 .. popd cmake --build build32_54 --config Release md plugin_lua54\Plugins\x86