]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: explicitly state that #cgo directives across multiple files are concatenated
authorPietro Gagliardi <pietro10@mac.com>
Wed, 21 May 2014 23:01:54 +0000 (16:01 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 21 May 2014 23:01:54 +0000 (16:01 -0700)
commit5eb585f211385d28b36f3df66b5bd7bde72a8e43
tree48f3484542307da7e6fa0b81184c65d49fcf3074
parent86e2a8edefb5a4ed6c8119283dcf164b0c1d4790
cmd/cgo: explicitly state that #cgo directives across multiple files are concatenated

This is a quick documentation change/clarification, as this
confused me before: in my own cgo-based projects, I currently have
identical #cgo directives in each relevant source file, and I notice
with go build -x that cgo is combining the directives, leading to
pkg-config invocations with the same package name (gtk+-3.0, in my
case) repeated several times, or on Mac OS X, LDFLAGS listing
-framework Foundation -framework AppKit multiple times. Since I am
about to add a CFLAGS as well, I checked the source to cmd/cgo and
go/build (where the work is actually done) to see if that still holds
true there. Hopefully other people who have made the same mistake I
have (I don't know if anyone has) can remove the excess declarations
now; this should make things slightly easier to manage as well.

LGTM=iant
R=golang-codereviews, gobot, iant
CC=golang-codereviews
https://golang.org/cl/91520046
src/cmd/cgo/doc.go