Use WSL for linux targets for more reliablitity

This commit is contained in:
Jaby 2022-12-06 04:56:26 +01:00 committed by Jaby
parent 95026f426b
commit 3f482578fe
2 changed files with 7 additions and 6 deletions

View File

@ -9,7 +9,6 @@ edition = "2021"
byteorder = "*" byteorder = "*"
cdtypes = {path = "../cdtypes"} cdtypes = {path = "../cdtypes"}
clap = {version = "*", features = ["derive"]} clap = {version = "*", features = ["derive"]}
lz4 = "*"
paste = "*" paste = "*"
roxmltree = "*" roxmltree = "*"
tool_helper = {path = "../tool_helper"} tool_helper = {path = "../tool_helper"}

View File

@ -5,10 +5,12 @@ rem run_cargo.bat project {build|check|clean|test} {debug|release} [linux|window
set org_dir=%cd% set org_dir=%cd%
set bin_ext=.exe set bin_ext=.exe
set target=x86_64-pc-windows-msvc set target=x86_64-pc-windows-msvc
set wsl=
IF %4 == linux ( IF %4 == linux (
set bin_ext= set bin_ext=
set target=x86_64-unknown-linux-musl set target=x86_64-unknown-linux-gnu
set wsl=wsl $HOME/.cargo/bin/
) )
IF defined CARGO_RUN_ARGS set run_args=-- %CARGO_RUN_ARGS% IF defined CARGO_RUN_ARGS set run_args=-- %CARGO_RUN_ARGS%
@ -19,7 +21,7 @@ IF %2 == test set run_build=1
cd %1 cd %1
IF defined run_build ( IF defined run_build (
echo cargo build %1 --%3 echo cargo build %1 --%3
cargo build --%3 --target=%target% %wsl%cargo build --%3 --target=%target%
IF %2 == build IF %ERRORLEVEL% == 0 ( IF %2 == build IF %ERRORLEVEL% == 0 (
xcopy target\%target%\%3\%1%bin_ext% %org_dir%\..\..\bin /y xcopy target\%target%\%3\%1%bin_ext% %org_dir%\..\..\bin /y
@ -30,21 +32,21 @@ IF defined run_build (
IF %2 == run ( IF %2 == run (
echo cargo run %1 --%3 echo cargo run %1 --%3
cargo run --%3 --target=%target% %run_args% %wsl%cargo run --%3 --target=%target% %run_args%
exit /B %ERRORLEVEL% exit /B %ERRORLEVEL%
) )
IF %2 == check ( IF %2 == check (
echo cargo check %1 --%3 echo cargo check %1 --%3
cargo check --%3 --target=%target% %wsl%cargo check --%3 --target=%target%
exit /B %ERRORLEVEL% exit /B %ERRORLEVEL%
) )
IF %2 == clean ( IF %2 == clean (
echo cargo clean %1 echo cargo clean %1
cargo clean %wsl%cargo clean
rem We do not delete the bin folder anymore - is kinda to much rem We do not delete the bin folder anymore - is kinda to much
rem @del %org_dir%\..\..\bin\%1%bin_ext% rem @del %org_dir%\..\..\bin\%1%bin_ext%