Skip to content

Commit

Permalink
add cross-platform-compilation explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
Allianzcortex authored Jan 28, 2018
1 parent a4e8393 commit e180c6a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,31 @@ Fanfou backup tools via golang

# <del>deprecated</del> delayed
饭否无法模拟登陆,问题暂时不想解决......以后有时间再做......

# 交叉编译


```
Windows 下编译 Mac 和 Linux 64位可执行程序
SET CGO_ENABLED=0
SET GOOS=darwin
SET GOARCH=amd64
go build main.go
SET CGO_ENABLED=0
SET GOOS=linux
SET GOARCH=amd64
go build main.go
```


Mac 下编译 Linux 和 Windows 64位可执行程序

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go

Linux 下编译 Mac 和 Windows 64位可执行程序

CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go

0 comments on commit e180c6a

Please sign in to comment.