build: building multi packages outputs to temporary path
This commit is contained in:
@@ -375,8 +375,16 @@ func linkMainPkg(ctx *context, pkg *packages.Package, pkgs []*aPackage, linkArgs
|
|||||||
name := path.Base(pkgPath)
|
name := path.Base(pkgPath)
|
||||||
app := conf.OutFile
|
app := conf.OutFile
|
||||||
if app == "" {
|
if app == "" {
|
||||||
|
if mode == ModeBuild && len(ctx.initial) > 1 {
|
||||||
|
// For multiple packages in ModeBuild mode, use temporary file
|
||||||
|
tmpFile, err := os.CreateTemp("", name+"*"+conf.AppExt)
|
||||||
|
check(err)
|
||||||
|
app = tmpFile.Name()
|
||||||
|
tmpFile.Close()
|
||||||
|
} else {
|
||||||
app = filepath.Join(conf.BinPath, name+conf.AppExt)
|
app = filepath.Join(conf.BinPath, name+conf.AppExt)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
args := make([]string, 0, len(pkg.Imports)+len(linkArgs)+16)
|
args := make([]string, 0, len(pkg.Imports)+len(linkArgs)+16)
|
||||||
args = append(
|
args = append(
|
||||||
args,
|
args,
|
||||||
|
|||||||
Reference in New Issue
Block a user