@echo off
REM Topaz Share 
REM : MSYS2 (winget install MSYS2.MSYS2) + MinGW-w64 UCRT64 GCC
REM GCC: C:\msys64\usr\bin\bash.exe -l -c "pacman -S --noconfirm mingw-w64-ucrt-x86_64-gcc"

SET GCC_PATH=C:\msys64\ucrt64\bin
SET CGO_ENABLED=1
SET CC=%GCC_PATH%\gcc.exe
SET PATH=%GCC_PATH%;%PATH%

IF NOT EXIST "%CC%" (
    exit /b 1
)


go build -ldflags="-H windowsgui" -o TopazShare.exe ./cmd/app
IF ERRORLEVEL 1 (
    exit /b 1
)

dir TopazShare.exe
