diff --git a/backend/build.bat b/backend/build.bat index ec92206..36408c8 100644 --- a/backend/build.bat +++ b/backend/build.bat @@ -1 +1,34 @@ -go build -ldflags="-H=windowsgui" -o nsfwapp.exe \ No newline at end of file +@echo off +setlocal + +echo Baue Windows x64... + +set GOOS=windows +set GOARCH=amd64 +set CGO_ENABLED=1 + +go build -ldflags="-H=windowsgui" -o nsfwapp.exe +if errorlevel 1 goto error + +echo. +echo Baue Debian/Linux x64 via WSL... + +for /f "delims=" %%i in ('wsl wslpath -a "%CD%"') do set "WSL_CWD=%%i" + +wsl --cd "%WSL_CWD%" bash -lc "GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o nsfwapp-linux-amd64" +if errorlevel 1 goto error + +echo. +echo Build erfolgreich. +echo Windows: nsfwapp.exe +echo Debian: nsfwapp-linux-amd64 +goto end + +:error +echo. +echo Build fehlgeschlagen. +exit /b 1 + +:end +endlocal +pause \ No newline at end of file