Skip to content

Commit e180c6a

Browse files
add cross-platform-compilation explanation
1 parent a4e8393 commit e180c6a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,31 @@ Fanfou backup tools via golang
33

44
# <del>deprecated</del> delayed
55
饭否无法模拟登陆,问题暂时不想解决......以后有时间再做......
6+
7+
# 交叉编译
8+
9+
10+
```
11+
Windows 下编译 Mac 和 Linux 64位可执行程序
12+
13+
SET CGO_ENABLED=0
14+
SET GOOS=darwin
15+
SET GOARCH=amd64
16+
go build main.go
17+
18+
SET CGO_ENABLED=0
19+
SET GOOS=linux
20+
SET GOARCH=amd64
21+
go build main.go
22+
```
23+
24+
25+
Mac 下编译 Linux 和 Windows 64位可执行程序
26+
27+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go
28+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go
29+
30+
Linux 下编译 Mac 和 Windows 64位可执行程序
31+
32+
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go
33+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go

0 commit comments

Comments
 (0)