加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
buildcross.bat 619 Bytes
一键复制 编辑 原始数据 按行查看 历史
Mateusz Czapliński 提交于 2015-11-02 21:59 . Speed-up buildcross.bat a bit
@echo off
rem NOTE: see also:
rem https://github.com/golang/go/wiki/WindowsCrossCompiling
rem https://github.com/golang/go/wiki/InstallFromSource#install-c-tools
for %%p in (windows_386 windows_amd64) do call :build rsrc %%p
set GOOS=
set GOARCH=
goto :eof
:build
set APP=%1
set PLATFORM=%2
:: Split param into GOOS & GOARCH (see: http://ss64.com/nt/syntax-substring.html)
set GOARCH=%PLATFORM:*_=%
call set GOOS=%%PLATFORM:_%GOARCH%=%%
:: Build filename
set FNAME=%APP%_%PLATFORM%
if "%GOOS%"=="windows" set FNAME=%FNAME%.exe
:: Do the build
echo %FNAME%
go build -i -v -o %FNAME% .
goto :eof
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化