Skip to content

Commit 35796ed

Browse files
committed
build.bat: temp fix for cross compile
1 parent 98c8d95 commit 35796ed

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

build.bat

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ set DOING=resources
121121
cd /d %~dp0
122122
echo Compiling all resources...
123123
FOR /D /r %%D in ("res/*") DO (
124-
%GOVERSIONINFO_PRG% %GOVERSIONINFO_OPTS% -icon res\%%~nxD\icon.ico -o res\%%~nxD\resource.syso src\versioninfo.json
124+
tools\goversioninfo %GOVERSIONINFO_OPTS% -icon res\%%~nxD\icon.ico -o res\%%~nxD\resource.syso src\versioninfo.json
125125
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
126126
)
127127
exit /b
@@ -146,7 +146,7 @@ exit /b
146146
set DOING=single
147147
cd /d %~dp0
148148
echo Compiling resource object...
149-
%GOVERSIONINFO_PRG% %GOVERSIONINFO_OPTS% -o src\resource.syso src\versioninfo.json
149+
tools\goversioninfo %GOVERSIONINFO_OPTS% -o src\resource.syso src\versioninfo.json
150150
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
151151
:singlewor
152152
set DOING=singlewor
@@ -172,8 +172,24 @@ exit /b
172172

173173
:dlgoversioninfo
174174
set DOING=dlgoversioninfo
175-
%GOVERSIONINFO_PRG% --help >NUL 2>&1
176-
if %ERRORLEVEL% NEQ 0 %GOPRG% install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.4.0
175+
cd /d %~dp0
176+
mkdir tools >NUL 2>&1
177+
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
178+
echo Downaloding goversioninfo 386...
179+
curl -sSfL https://github.com/yuk7/goversioninfo/releases/download/v1.2.0-arm/goversioninfo_386.exe -o tools\goversioninfo.exe
180+
) else if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
181+
echo Downaloding goversioninfo amd64...
182+
curl -sSfL https://github.com/yuk7/goversioninfo/releases/download/v1.2.0-arm/goversioninfo_amd64.exe -o tools\goversioninfo.exe
183+
) else if "%PROCESSOR_ARCHITECTURE%"=="ARM" (
184+
echo Downaloding goversioninfo ARM...
185+
curl -sSfL https://github.com/yuk7/goversioninfo/releases/download/v1.2.0-arm/goversioninfo_arm.exe -o tools\goversioninfo.exe
186+
) else if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
187+
echo Downaloding goversioninfo ARM64...
188+
curl -sSfL https://github.com/yuk7/goversioninfo/releases/download/v1.2.0-arm/goversioninfo_arm64.exe -o tools\goversioninfo.exe
189+
) else (
190+
echo ERROR: %PROCESSOR_ARCHITECTURE% is not supported for build environment
191+
)
192+
if not exist tools\goversioninfo.exe exit /b 1
177193
exit /b
178194

179195
:failed

0 commit comments

Comments
 (0)