Introduce Linux counter parts

This commit is contained in:
2023-10-06 17:02:30 +02:00
parent c85d50a022
commit 1eb6f2e0bd
5 changed files with 74 additions and 55 deletions

View File

@@ -1,30 +1,25 @@
@echo off
setlocal EnableDelayedExpansion
rem run_cargo.bat project {build|check|clean|test} {debug|release} [linux|windows]
rem run_cargo.bat project {build|check|clean} {debug|release} [linux|windows]
set org_dir=%cd%
set bin_ext=.exe
set target=x86_64-pc-windows-msvc
set wsl=
IF %4 == linux (
set bin_ext=
set target=x86_64-unknown-linux-gnu
set wsl=wsl --shell-type login
wsl --shell-type login ./run_cargo.sh %1 %2 %3
exit /B %ERRORLEVEL%
)
IF defined CARGO_RUN_ARGS set run_args=-- %CARGO_RUN_ARGS%
IF %2 == build set run_build=1
IF %2 == test set run_build=1
cd %1
IF defined run_build (
IF %2 == build (
echo cargo build %1 --%3
%wsl%cargo build --%3 --target=%target%
IF %2 == build IF %ERRORLEVEL% == 0 (
xcopy target\%target%\%3\%1%bin_ext% %org_dir%\..\..\bin /y
IF %ERRORLEVEL% == 0 (
xcopy target\%target%\%3\%1.exe %org_dir%\..\..\bin /y
)
exit /B %ERRORLEVEL%