builder

package
v0.0.0-...-40f31e6 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Unlicense Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GeneratorNinja  = "ninja"
	GeneratorQobs   = "qobs"
	GeneratorVS2022 = "vs2022"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilderInDirectory

func NewBuilderInDirectory(path string, features []string, defaultFeatures bool) (*Builder, error)

func (*Builder) Build

func (b *Builder) Build(profile, generator string) error

Build resolves the entire dependency graph and then invokes the generator (or builder)

func (*Builder) BuildAndRun

func (b *Builder) BuildAndRun(args []string, profile, generator string) error

type Config

type Config struct {
	Package      PackageSection            `toml:"package"`
	Target       TargetSection             `toml:"target"`
	Dependencies map[string]Dependency     `toml:"dependencies"`
	Profile      map[string]ProfileSection `toml:"profile"`
	Features     FeaturesSection           `toml:"features"`
	// contains filtered or unexported fields
}

func ParseConfig

func ParseConfig(rdr io.Reader, env ConfigEnv, defaultFeatures bool) (*Config, error)

func ParseConfigFromFile

func ParseConfigFromFile(path string, env ConfigEnv, defaultFeatures bool) (*Config, error)

ParseConfigFromFile parses and validates a config file from a filepath

func (Config) Profiles

func (c Config) Profiles() []string

func (Config) RunBuildScript

func (cfg Config) RunBuildScript(env ConfigEnv) error

type ConfigEnv

type ConfigEnv struct {
	TargetOS   string            `expr:"target_os"`
	TargetArch string            `expr:"target_arch"`
	Environ    map[string]string `expr:"environ"`
	Features   map[string]bool   `expr:"-"`
	// contains filtered or unexported fields
}

func NewConfigEnv

func NewConfigEnv(basedir string) ConfigEnv

func NewConfigEnvWithFeatures

func NewConfigEnvWithFeatures(basedir string, features map[string]bool) ConfigEnv

type Dependency

type Dependency struct {
	Source          string   `toml:"dep"`
	DefaultFeatures bool     `toml:"default-features"`
	Features        []string `toml:"features"`
}

func (*Dependency) UnmarshalTOML

func (d *Dependency) UnmarshalTOML(v any) error

type FeaturesSection

type FeaturesSection map[string][]string

FeaturesSection defines the [features] section

func (FeaturesSection) ResolveFeatures

func (f FeaturesSection) ResolveFeatures(requested []string, useDefault bool) (
	ownFeatures map[string]bool,
	depFeatures map[string][]string,
	err error,
)

type Package

type Package struct {
	Name   string
	Path   string
	Config *Config
	IsRoot bool
}

Package represents a single component (root package or dependency) in the build graph

type PackageSection

type PackageSection struct {
	Name        string   `toml:"name"`
	Description string   `toml:"description"`
	Authors     []string `toml:"authors"`
	Build       string   `toml:"build"`
}

PackageSection defines the [package] section

type ProfileSection

type ProfileSection struct {
	OptLevel intOrString `toml:"opt-level"`
}

ProfileSection defines the [profile.*] section

type TargetSection

type TargetSection struct {
	Lib        bool              `toml:"lib"`
	HeaderOnly bool              `toml:"header-only"`
	Sources    []string          `toml:"sources"`
	Headers    []string          `toml:"headers"`
	Defines    map[string]string `toml:"defines"`
	Links      []string          `toml:"links"`
	Cflags     []string          `toml:"cflags"`
}

TargetSection defines the [target(.*)] section

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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