platform

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultArchForHost

func DefaultArchForHost(host, qtVersion string) string

DefaultArchForHost returns the default Qt arch for a given host platform identifier (e.g. "windows_arm64"). This is used when --host overrides auto-detection so the default arch matches the target host, not the local machine. Returns "" if the host is unrecognized.

func GOARCH

func GOARCH() string

GOARCH returns the current architecture (mirrors runtime.GOARCH).

func GOOS

func GOOS() string

GOOS returns the current operating system name (mirrors runtime.GOOS).

func VCRedistPresent

func VCRedistPresent(year string) bool

VCRedistPresent checks whether the Visual C++ redistributable is installed.

Types

type Darwin

type Darwin struct{}

Darwin implements Platform for macOS.

func (*Darwin) CheckCompilerPresent

func (d *Darwin) CheckCompilerPresent(_ string) (bool, string)

func (*Darwin) DefaultArch

func (d *Darwin) DefaultArch(_ string) string

func (*Darwin) DefaultInstallDir

func (d *Darwin) DefaultInstallDir() string

type Linux

type Linux struct{}

Linux implements Platform for Linux.

func (*Linux) CheckCompilerPresent

func (l *Linux) CheckCompilerPresent(_ string) (bool, string)

func (*Linux) DefaultArch

func (l *Linux) DefaultArch(_ string) string

func (*Linux) DefaultInstallDir

func (l *Linux) DefaultInstallDir() string

type Platform

type Platform interface {
	// DefaultInstallDir returns the default Qt install directory.
	DefaultInstallDir() string
	// DefaultArch returns the recommended Qt arch for this machine.
	DefaultArch(qtVersion string) string
	// CheckCompilerPresent reports whether the expected compiler for arch is available.
	CheckCompilerPresent(arch string) (bool, string)
}

Platform provides platform-specific information and defaults.

func Current

func Current() Platform

Current returns the Platform implementation for the current OS.

type Windows

type Windows struct{}

Windows implements Platform for Windows.

func (*Windows) CheckCompilerPresent

func (w *Windows) CheckCompilerPresent(arch string) (bool, string)

func (*Windows) DefaultArch

func (w *Windows) DefaultArch(qtVersion string) string

func (*Windows) DefaultInstallDir

func (w *Windows) DefaultInstallDir() string

Jump to

Keyboard shortcuts

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