From: Gustavo Niemeyer Date: Mon, 30 Jan 2012 18:04:45 +0000 (-0200) Subject: cmd/go: fix including of _cgo_export.h X-Git-Tag: weekly.2012-02-07~222 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d59c88786dc3a27876c782e2639ade5feae520fc;p=gostls13.git 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 --- 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"}