Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions go.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type CompileOpts struct {
ModMode string
Cgo bool
Rebuild bool
Buildmode string
GoCmd string
}

Expand Down Expand Up @@ -111,6 +112,9 @@ func GoCrossCompile(opts *CompileOpts) error {
if opts.ModMode != "" {
args = append(args, "-mod", opts.ModMode)
}
if opts.Buildmode != "" {
args = append(args, "-buildmode", opts.Buildmode)
}
args = append(args,
"-gcflags", opts.Gcflags,
"-ldflags", opts.Ldflags,
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func realMain() int {
var platformFlag PlatformFlag
var tags string
var verbose bool
var flagGcflags, flagAsmflags string
var flagGcflags, flagAsmflags, flagBuildmode string
var flagCgo, flagRebuild, flagListOSArch bool
var flagGoCmd string
var modMode string
Expand All @@ -44,6 +44,7 @@ func realMain() int {
flags.BoolVar(&flagCgo, "cgo", false, "")
flags.BoolVar(&flagRebuild, "rebuild", false, "")
flags.BoolVar(&flagListOSArch, "osarch-list", false, "")
flags.StringVar(&flagBuildmode, "buildmode", "", "")
flags.StringVar(&flagGcflags, "gcflags", "", "")
flags.StringVar(&flagAsmflags, "asmflags", "", "")
flags.StringVar(&flagGoCmd, "gocmd", "go", "")
Expand Down Expand Up @@ -161,6 +162,7 @@ func realMain() int {
ModMode: modMode,
Cgo: flagCgo,
Rebuild: flagRebuild,
Buildmode: flagBuildmode,
GoCmd: flagGoCmd,
}

Expand Down Expand Up @@ -214,6 +216,7 @@ Options:
-asmflags="" Additional '-asmflags' value to pass to go build
-tags="" Additional '-tags' value to pass to go build
-mod="" Additional '-mod' value to pass to go build
-buildmode="" Additional '-buildmode' value to pass to go build
-os="" Space-separated list of operating systems to build for
-osarch="" Space-separated list of os/arch pairs to build for
-osarch-list List supported os/arch pairs for your Go version
Expand Down