30 lines
976 B
Batchfile
30 lines
976 B
Batchfile
@echo off
|
|
setlocal EnableDelayedExpansion
|
|
|
|
if "%~1"=="help" goto :help
|
|
if "%~1"=="" goto :help
|
|
if "%~1"=="--help" goto :help
|
|
if "%~1"=="/?" goto :help
|
|
if "%~2"=="" goto :help
|
|
goto :run
|
|
|
|
:help
|
|
echo USAGE: msys2_env.bat ^<environment^> ^<command^>
|
|
echo.
|
|
echo ENVIRONMENTS:
|
|
echo ^| Name ^| Toolchain ^| Arch ^| C Runtime ^| C++ Runtime ^|
|
|
echo ^| 'clang64' ^| llvm ^| x64 ^| ucrt ^| libc++ ^|
|
|
echo ^| 'mingw32' ^| gcc ^| x86 ^| msvcrt ^| libstdc++ ^|
|
|
echo ^| 'mingw64' ^| gcc ^| x64 ^| msvcrt ^| libstdc++ ^|
|
|
echo ^| 'msys2' ^| gcc ^| x64 ^| cygwin ^| libstdc++ ^|
|
|
echo ^| 'ucrt64' ^| gcc ^| x64 ^| ucrt ^| libstdc++ ^|
|
|
goto :eof
|
|
|
|
:run
|
|
set msys_env=%~1
|
|
for /f "tokens=1,* delims= " %%a in ("%*") do set remaining_args=%%b
|
|
|
|
set cmd=%devenver_root%\MSYS2\20240113\msys2_shell.cmd -%msys_env% -no-start -defterm -here -c "%remaining_args%"
|
|
echo [SCRIPT] Executing '%cmd%'
|
|
%cmd%
|