]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix including of _cgo_export.h
authorGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 1 Feb 2012 18:07:32 +0000 (16:07 -0200)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 1 Feb 2012 18:07:32 +0000 (16:07 -0200)
This will add the temporary object directory into the lookup
path so that cgo-exported function declarations may be
included from C files.

This was previously applied by CL 5600043, and apparently
removed by mistake on CL 5598045.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5610054

src/cmd/go/build.go

index 5f3cbb4574f81a3eee96d9913e3325d7e81248a9..bad37df21c5cc48eee59e8560fb8b30277147909 100644 (file)
@@ -1148,6 +1148,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"}