mirror of
https://github.com/golang/go
synced 2024-11-19 21:14:43 -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:
parent
facee93a86
commit
eac86fd3f0
@ -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...)
|
||||||
|
Loading…
Reference in New Issue
Block a user