-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.bat
More file actions
46 lines (37 loc) · 2.19 KB
/
setup.bat
File metadata and controls
46 lines (37 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
setlocal EnableDelayedExpansion
for /f %%a in ('powershell -Command "[int](Get-Date -UFormat %%s)"') do set START_TIME=%%a
set "CURRENT_DIR=%~dp0"
cd %CURRENT_DIR%
set "EXT_DIR=%CURRENT_DIR%ext"
set "MSYS2_DIR=%EXT_DIR%\msys2"
set "MINGW32_MAKE_EXE=%MSYS2_DIR%\mingw64\bin\mingw32-make.exe"
if not exist "%MSYS2_DIR%" (
mkdir "%MSYS2_DIR%"
powershell -NoProfile -Command "C:\Windows\System32\curl.exe --ssl-no-revoke -L -o '%MSYS2_DIR%\msys2-x86_64-20241208.exe' 'https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe'; %MSYS2_DIR%\msys2-x86_64-20241208.exe in --confirm-command --accept-messages --root %MSYS2_DIR%"
powershell -NoProfile -Command "%MSYS2_DIR%\msys2_shell.cmd -defterm -here -no-start -c 'pacman -Syu --noconfirm'"
powershell -NoProfile -Command "%MSYS2_DIR%\msys2_shell.cmd -defterm -here -no-start -c 'pacman -Sy --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-make'"
powershell -NoProfile -Command "%MSYS2_DIR%\msys2_shell.cmd -defterm -here -no-start -c 'pacman -Syu --noconfirm'"
echo MSYS2 installation complete.
) else (
echo MSYS2 already installed. Updating packages...
powershell -NoProfile -Command "%MSYS2_DIR%\msys2_shell.cmd -defterm -here -no-start -c 'pacman -Syu --noconfirm'"
echo Updating packages complete.
)
echo Building multiverse_server...
cd multiverse_server
powershell -NoProfile -Command "%MSYS2_DIR%\msys2_shell.cmd -defterm -here -no-start -mingw64 -c 'mingw32-make clean && mingw32-make'"
cd ..
echo Building multiverse_client...
cd multiverse_client
powershell -NoProfile -Command "%MSYS2_DIR%\msys2_shell.cmd -defterm -here -no-start -mingw64 -c 'mingw32-make clean && mingw32-make'"
for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
call "%%i\VC\Auxiliary\Build\vcvarsall.bat" x64
)
nmake clean -f Makefile.nmake
nmake -f Makefile.nmake
cd ..
for /f %%a in ('powershell -Command "[int](Get-Date -UFormat %%s)"') do set END_TIME=%%a
set /a ELAPSED=%END_TIME% - %START_TIME%
echo Build completed in %ELAPSED% seconds
endlocal