mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: document CGO_LDFLAGS and CGO_CFLAGS
Fixes #3203. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5769043
This commit is contained in:
parent
e8d1852d6a
commit
f4b40d92c8
1 changed files with 5 additions and 0 deletions
|
|
@ -44,6 +44,11 @@ For example:
|
||||||
// #include <png.h>
|
// #include <png.h>
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
The CGO_CFLAGS and CGO_LDFLAGS environment variables are added
|
||||||
|
to the flags derived from these directives. Package-specific flags should
|
||||||
|
be set using the directives, not the environment variables, so that builds
|
||||||
|
work in unmodified environments.
|
||||||
|
|
||||||
Within the Go file, C identifiers or field names that are keywords in Go
|
Within the Go file, C identifiers or field names that are keywords in Go
|
||||||
can be accessed by prefixing them with an underscore: if x points at a C
|
can be accessed by prefixing them with an underscore: if x points at a C
|
||||||
struct with a field named "type", x._type accesses the field.
|
struct with a field named "type", x._type accesses the field.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue