1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:54:40 -07:00

cmd/go: pass env CGO_CFLAGS to cgo

Passing the CGO_CFLAGS to cgo is required to make alternative include
directories work when building a cgo project.

R=rsc
CC=golang-dev
https://golang.org/cl/5635048
This commit is contained in:
Jeff Hodges 2012-02-06 11:26:15 -05:00 committed by Russ Cox
parent facee93a86
commit eac86fd3f0

View File

@ -1183,7 +1183,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
if _, ok := buildToolchain.(gccgoToolchain); ok { if _, ok := buildToolchain.(gccgoToolchain); ok {
cgoflags = append(cgoflags, "-gccgo") cgoflags = append(cgoflags, "-gccgo")
} }
if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, cgoflags, "--", p.CgoFiles); err != nil { if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, cgoflags, "--", cgoCFLAGS, p.CgoFiles); err != nil {
return nil, nil, err return nil, nil, err
} }
outGo = append(outGo, gofiles...) outGo = append(outGo, gofiles...)