mirror of
https://github.com/golang/go
synced 2024-11-21 23:54:40 -07:00
cgo: write _cgo_export.h to object directory, not source dir
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5540048
This commit is contained in:
parent
630c838886
commit
ba0e02b207
@ -396,7 +396,7 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
|
|||||||
// from Go so that they are callable from C.
|
// from Go so that they are callable from C.
|
||||||
func (p *Package) writeExports(fgo2, fc, fm *os.File) {
|
func (p *Package) writeExports(fgo2, fc, fm *os.File) {
|
||||||
fgcc := creat(*objDir + "_cgo_export.c")
|
fgcc := creat(*objDir + "_cgo_export.c")
|
||||||
fgcch := creat("_cgo_export.h")
|
fgcch := creat(*objDir + "_cgo_export.h")
|
||||||
|
|
||||||
fmt.Fprintf(fgcch, "/* Created by cgo - DO NOT EDIT. */\n")
|
fmt.Fprintf(fgcch, "/* Created by cgo - DO NOT EDIT. */\n")
|
||||||
fmt.Fprintf(fgcch, "%s\n", gccExportHeaderProlog)
|
fmt.Fprintf(fgcch, "%s\n", gccExportHeaderProlog)
|
||||||
|
@ -396,8 +396,7 @@ func (b *build) cgo(cgofiles, cgocfiles []string) (outGo, outObj []string) {
|
|||||||
Output: output,
|
Output: output,
|
||||||
})
|
})
|
||||||
outGo = append(outGo, gofiles...)
|
outGo = append(outGo, gofiles...)
|
||||||
exportH := filepath.Join(b.path, "_cgo_export.h")
|
b.script.addIntermediate(defunC, b.obj+"_cgo_export.h", b.obj+"_cgo_flags")
|
||||||
b.script.addIntermediate(defunC, exportH, b.obj+"_cgo_flags")
|
|
||||||
b.script.addIntermediate(cfiles...)
|
b.script.addIntermediate(cfiles...)
|
||||||
|
|
||||||
// cc _cgo_defun.c
|
// cc _cgo_defun.c
|
||||||
|
Loading…
Reference in New Issue
Block a user