diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 8a895b41e28..659e5fce97a 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"}