From c8559a24ca8b4fc5809974194a1a5762413726ff Mon Sep 17 00:00:00 2001 From: xiaoqidun Date: Wed, 23 Sep 2020 15:00:39 +0800 Subject: [PATCH] =?UTF-8?q?docs(=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3):=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ca6b2b..f24ea18 100644 --- a/README.md +++ b/README.md @@ -50,4 +50,21 @@ export GOOS=windows export GOARCH=amd64 export CGO_ENABLED=0 go build -o main_windows_amd64.exe main.go -``` \ No newline at end of file +``` + +# 编译说明 + +## GOOS +> 用于标识编译的目标操作系统 + +## GOARCH +> 用于标识编译的目标系统架构 + +## CGO_ENABLED + +- 0 静态编译,禁用CGO,适用于android和darwin(apple)外的目标操作系统 +- 1 动态编译,使用CGO,适用于依靠外部工具链才能完成编译的目标操作系统 + +## 动态编译 + +- 动态编译必须设置CC变量,指定C编译器可执行文件路径或者在PATH变量内的可执行C编译器名称