aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2012-01-30 16:04:45 -0200
committerGustavo Niemeyer <gustavo@niemeyer.net>2012-01-30 16:04:45 -0200
commitd59c88786dc3a27876c782e2639ade5feae520fc (patch)
tree934d4f6dca570df0da9a5d2fcabbbfb04ea4439a /src
parent74e8a1308a5b67b2482b46f32de05c87220793fc (diff)
downloadgo-d59c88786dc3a27876c782e2639ade5feae520fc.tar.xz
cmd/go: fix including of _cgo_export.h
This will add the temporary object directory into the lookup path so that cgo-exported function declarations may be included from C files. R=golang-dev, rogpeppe, rsc CC=golang-dev https://golang.org/cl/5600043
Diffstat (limited to 'src')
-rw-r--r--src/cmd/go/build.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
index 8a895b41e2..659e5fce97 100644
--- a/src/cmd/go/build.go
+++ b/src/cmd/go/build.go
@@ -1146,6 +1146,9 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
}
}
+ // Allows including _cgo_export.h from .[ch] files in the package.
+ cgoCFLAGS = append(cgoCFLAGS, "-I", obj)
+
// cgo
// TODO: CGOPKGPATH, CGO_FLAGS?
gofiles := []string{obj + "_cgo_gotypes.go"}