浏览代码

build: fix xgo argument order when building from make

Péter Szilágyi 8 年之前
父节点
当前提交
2b284e7366
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      build/ci.go

+ 4 - 1
build/ci.go

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