From d6dff636ea790b5c0ca80b8888fcdd6961b3b922 Mon Sep 17 00:00:00 2001 From: Michael Schaller Date: Thu, 2 Apr 2015 13:15:08 +0200 Subject: [PATCH] cmd/go: print SWIG warnings Fixes #9053 Change-Id: I7b9af3647800671f065c366a6adf9278e64ebec9 Reviewed-on: https://go-review.googlesource.com/8400 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/cmd/go/build.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index 61453c7e2b..bdc350161a 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -2645,16 +2645,20 @@ func (b *builder) swigOne(p *Package, file, obj string, pcCFLAGS []string, cxx b args = append(args, "-c++") } - if out, err := b.runOut(p.Dir, p.ImportPath, nil, "swig", args, file); err != nil { + out, err := b.runOut(p.Dir, p.ImportPath, nil, "swig", args, file) + if err != nil { if len(out) > 0 { if bytes.Contains(out, []byte("-intgosize")) || bytes.Contains(out, []byte("-cgo")) { return "", "", errors.New("must have SWIG version >= 3.0.6") } - b.showOutput(p.Dir, p.ImportPath, b.processOutput(out)) + b.showOutput(p.Dir, p.ImportPath, b.processOutput(out)) // swig error return "", "", errPrintedOutput } return "", "", err } + if len(out) > 0 { + b.showOutput(p.Dir, p.ImportPath, b.processOutput(out)) // swig warning + } return obj + goFile, obj + gccBase + gccExt, nil } -- 2.48.1