gobuild

package
v1.58.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(ctx context.Context, in CompileInput) error

Compile compiles a Go program.

func Exe

func Exe(ctx context.Context, in ExeInput) error

Exe compiles a Go binary.

Types

type CompileInput

type CompileInput struct {
	Target Platform

	// The working directory for the build.
	WorkingDir FSPath

	// Argument for the main package.
	MainPkg string

	// The path to the macOS SDK. Only needed when cross-compiling to macOS
	// from another OS; native macOS builds use the Xcode toolchain.
	CrossMacSDKPath option.Option[FSPath]

	// The output path for the compiled executable.
	OutExecutablePath FSPath

	// Extra flags to pass to the linker.
	ExtraLdFlags []string
}

type ExeInput

type ExeInput struct {
	Host   HostInfo
	Target Platform

	// The path to the MacOS SDK. Must be set for cross-compiles to macOS.
	CrossMacSDKPath option.Option[FSPath]

	// Version string to embed in the binary.
	Version string

	// Where to invoke the 'go build' command from.
	WorkingDir FSPath

	// The main package to build, relative to the working directory.
	MainPkg string

	// Output exe path.
	OutExePath FSPath
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址