mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
cmd/gogio: add -linkmode flags
For experimenting with https://github.com/golang/go/issues/38918. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -31,6 +31,7 @@ var (
|
||||
version = flag.Int("version", 1, "app version (for -buildmode=exe)")
|
||||
printCommands = flag.Bool("x", false, "print the commands")
|
||||
keepWorkdir = flag.Bool("work", false, "print the name of the temporary work directory and do not delete it when exiting.")
|
||||
linkMode = flag.String("linkmode", "", "set the -linkmode flag of the go tool")
|
||||
)
|
||||
|
||||
type buildInfo struct {
|
||||
@@ -118,6 +119,9 @@ func mainErr() error {
|
||||
// Pass along arguments to the app.
|
||||
ldflags = append(ldflags, fmt.Sprintf("-X gioui.org/app.extraArgs=%s", strings.Join(appArgs, "|")))
|
||||
}
|
||||
if m := *linkMode; m != "" {
|
||||
ldflags = append(ldflags, "-linkmode="+m)
|
||||
}
|
||||
bi.ldflags = strings.Join(ldflags, " ")
|
||||
if err := build(bi); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user