mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +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)")
|
version = flag.Int("version", 1, "app version (for -buildmode=exe)")
|
||||||
printCommands = flag.Bool("x", false, "print the commands")
|
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.")
|
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 {
|
type buildInfo struct {
|
||||||
@@ -118,6 +119,9 @@ func mainErr() error {
|
|||||||
// Pass along arguments to the app.
|
// Pass along arguments to the app.
|
||||||
ldflags = append(ldflags, fmt.Sprintf("-X gioui.org/app.extraArgs=%s", strings.Join(appArgs, "|")))
|
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, " ")
|
bi.ldflags = strings.Join(ldflags, " ")
|
||||||
if err := build(bi); err != nil {
|
if err := build(bi); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user