mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: update #cgo docs to reflect reality
The syntax accepted is full build constraints, not just GOOS, GOARCH, and GOOS/GOARCH. R=golang-dev, iant CC=golang-dev https://golang.org/cl/13504048
This commit is contained in:
parent
05ff4d7a1a
commit
3c1ece2cb4
1 changed files with 5 additions and 3 deletions
|
|
@ -27,11 +27,13 @@ http://golang.org/doc/articles/c_go_cgo.html.
|
|||
CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS may be defined with pseudo #cgo
|
||||
directives within these comments to tweak the behavior of the C or C++
|
||||
compiler. Values defined in multiple directives are concatenated
|
||||
together. Options prefixed by $GOOS, $GOARCH, or $GOOS/$GOARCH are
|
||||
only defined in matching systems. For example:
|
||||
together. The directive can include a list of build constraints limiting its
|
||||
effect to systems satisfying one of the constraints
|
||||
(see http://golang.org/pkg/go/build/#hdr-Build_Constraints for details about the constraint syntax).
|
||||
For example:
|
||||
|
||||
// #cgo CFLAGS: -DPNG_DEBUG=1
|
||||
// #cgo linux CFLAGS: -DLINUX=1
|
||||
// #cgo amd64 386 CFLAGS: -DX86=1
|
||||
// #cgo LDFLAGS: -lpng
|
||||
// #include <png.h>
|
||||
import "C"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue