build: fix xgo argument order when building from make

This commit is contained in:
Péter Szilágyi 2017-03-03 12:18:44 +02:00
parent faf713632c
commit 2b284e7366
No known key found for this signature in database
GPG Key ID: E9AE538CEDF8293D
1 changed files with 4 additions and 1 deletions

View File

@ -930,9 +930,9 @@ func doXgo(cmdline []string) {
// If all tools building is requested, build everything the builder wants // If all tools building is requested, build everything the builder wants
args := append(buildFlags(env), flag.Args()...) args := append(buildFlags(env), flag.Args()...)
args = append(args, []string{"--dest", GOBIN}...)
if *alltools { if *alltools {
args = append(args, []string{"--dest", GOBIN}...)
for _, res := range allToolsArchiveFiles { for _, res := range allToolsArchiveFiles {
if strings.HasPrefix(res, GOBIN) { if strings.HasPrefix(res, GOBIN) {
// Binary tool found, cross build it explicitly // Binary tool found, cross build it explicitly
@ -945,6 +945,9 @@ func doXgo(cmdline []string) {
return return
} }
// Otherwise xxecute the explicit cross compilation // Otherwise xxecute the explicit cross compilation
path := args[len(args)-1]
args = append(args[:len(args)-1], []string{"--dest", GOBIN, path}...)
xgo := xgoTool(args) xgo := xgoTool(args)
build.MustRun(xgo) build.MustRun(xgo)
} }