1. 程式人生 > >go交叉編譯指令碼命令

go交叉編譯指令碼命令

::只顯示echo
@echo off
::設定DOS環境的字型顏色
@color 06


::設定GOPATH路徑和golandIDE相同
SET projectName=apetboss
SET projectPath=F:\project\h5gamesvr
SET GOPATH=%projectPath%

;SET CGO_ENABLED=0
;SET GOOS=linux
;SET GOARCH=amd64
;go build  -v -o build/%projectName% %CD%\src\server\main.go
echo "--------- %DATE%%TIME% Build For %projectName% Success!"

SET CGO_ENABLED=0
SET GOOS=windows
SET GOARCH=386
go build  -v -o build/%projectName%.exe %CD%\src\server\main.go
echo "--------- %DATE%%TIME% Build For %projectName%.exe Success!"
pause