【环境篇】golang环境变量二三事(三)

GCCGO

The gccgo command to run for 'go build -compiler=gccgo'.

表示"go build -compiler=gccgo",编译时指定的-compiler参数。

AR

The command to use to manipulate library archives when
building with the gccgo compiler.
The default is 'ar'.

打包工具,默认"ar"。

CC

The command to use to compile C code.

编译C语言的工具。

CGO_ENABLED

Whether the cgo command is supported. Either 0 or 1.

是否使用cgo。

CGO_CFLAGS

Flags that cgo will pass to the compiler when compiling C code.

指定编译C语言代码时的参数

CGO_CPPFLAGS 和 CGO_CXXFLAGS

Like CGO_CFLAGS, CGO_CFLAGS_ALLOW, and CGO_CFLAGS_DISALLOW,
but for the C preprocessor and C++ compiler.

这两个类似于CGO_CFLAGS,CGO_CPPFLAGS 指定C语言预处理器的编译参数,CGO_CXXFLAGS指定C++的编译参数。

GOGCCFLAGS

环境信息GOGCCFLAGS的值则是Go语言在使用操作系统的默认C语言编译器对C语言代码进行编译时加入的参数。

小结

我对cgo的了解不多,以后会对cgo进一步学习,若想了解其他更多环境变量的知识,我这里看到一篇不错的文章,供大家参考:https://wiki.jikexueyuan.com/project/go-command-tutorial/0.14.html


欢迎关注我的公众号:onepunchgo,会整理相关的文档和资料。

image

猜你喜欢

转载自blog.51cto.com/14664952/2467609
今日推荐