silk.build.definition.

Typed compilation definitions whose defaults and package inputs the toolchain resolves.

Import as Definition with import silk.build.definition { Definition }.

Public declarations: 5.

Definition#

silk
pub struct Definition

A package-backed compilation before target defaults, imports, and plans are resolved.

Field manifest#

silk
pub manifest: String

The absolute manifest path defining the available packages.

Field name#

silk
pub name: Option<String>

The artifact name; absent uses the package name.

Field artifact#

silk
pub artifact: Option<String>

The artifact shape; absent uses the package's default.

Field stdlib#

silk
pub stdlib: Option<String>

The standard-library root; absent uses the compiler installation.

Field settings#

silk
pub settings: Settings

Values selected by the command after its deferred inputs complete.

Field packages#

silk
pub packages: Dictionary<Package>

Overrides keyed by declared dependency alias, or self for the root package.

Implementation Schema for Definition#

silk
impl Schema for Definition

Operation spec#

silk
static fn spec() -> Spec<Definition>

Settings#

silk
pub struct Settings

Compilation settings without target-dependent defaults. Lists preserve the command's order.

Field profile#

silk
pub profile: Profile

Optional program-wide source and backend settings.

Field root#

silk
pub root: Option<String>

An absolute root module path; absent uses the package entry.

Field modules#

silk
pub modules: List<Module>

Generated modules added to the root package.

Field native#

silk
pub native: Native

Additional native translation units and link inputs.

Field emit#

silk
pub emit: Option<String>

The emitted form; absent selects the final artifact.

Field platform#

silk
pub platform: Option<Platform>

An explicit sysroot, linker, and support installations.

Field windows#

silk
pub windows: Option<Windows>

Windows link settings.

Field macos#

silk
pub macos: Option<MacOS>

macOS link and signing settings.

Field wasm#

silk
pub wasm: Option<Wasm>

WebAssembly memory, execution, and interface settings.

Field header#

silk
pub header: Option<String>

The requested C header output path.

Field importLibrary#

silk
pub importLibrary: Option<String>

The requested import library output path.

Field runner#

silk
pub runner: Option<Runner>

The program and arguments used to launch the artifact.

Implementation Schema for Settings#

silk
impl Schema for Settings

Operation spec#

silk
static fn spec() -> Spec<Settings>

Implementation Settings#

silk
impl Settings

Associated function make#

silk
pub fn make() -> Self

Returns settings that leave target-dependent defaults to the compiler.

Package#

silk
pub struct Package

Overrides for one declared package, without changing program-wide source facts.

Field optimization#

silk
pub optimization: Option<String>

The defining package's code-generation optimization.

Field debug#

silk
pub debug: Option<bool>

Whether code defined in this package emits debug information.

Field parameters#

silk
pub parameters: List<Parameter>

Parameters named by module and declaration.

Field excluded#

silk
pub excluded: bool

Whether this compilation excludes the declared dependency.

Implementation Schema for Package#

silk
impl Schema for Package

Operation spec#

silk
static fn spec() -> Spec<Package>

Operation check#

silk
fn check(self: &Self, checks: &mut Checks<Self>) -> ()

Parameter#

silk
pub struct Parameter

A typed parameter binding supplied by a root command.

Field module#

silk
pub module: String

The package-relative module path declaring the parameter.

Field name#

silk
pub name: String

The parameter declaration's name.

Field value#

silk
pub value: ParameterValue

The supplied value, interpreted against the declared parameter schema.

Field suppliedPath#

silk
pub suppliedPath: bool

Whether this value grants a supplied-path capability to the package's plan.

Implementation Schema for Parameter#

silk
impl Schema for Parameter

Operation spec#

silk
static fn spec() -> Spec<Parameter>

Operation check#

silk
fn check(self: &Self, checks: &mut Checks<Self>) -> ()

Profile#

silk
pub struct Profile

Optional source facts and backend settings, resolved by the compiler's target policy.

Field target#

silk
pub target: Option<String>

The canonical target triple.

Field cpu#

silk
pub cpu: Option<String>

The CPU model.

Field cpuFeatures#

silk
pub cpuFeatures: Option<List<String>>

The enabled CPU features.

Field deployment#

silk
pub deployment: Option<String>

The minimum operating-system version.

Field libc#

silk
pub libc: Option<String>

The selected C library.

Field entry#

silk
pub entry: Option<String>

The entry selection: default, none, or a declared name.

Field runtime#

silk
pub runtime: Option<String>

The runtime selection: default, none, or a declared name.

silk
pub link: Option<String>

The link mode.

Field codeModel#

silk
pub codeModel: Option<String>

The target code model.

Field relocation#

silk
pub relocation: Option<String>

The relocation model.

Field optimization#

silk
pub optimization: Option<String>

The program-wide optimization: none, speed, or size.

Field debug#

silk
pub debug: Option<bool>

Whether the program emits debug information by default.

Field safety#

silk
pub safety: Option<String>

The program-wide safety policy.

Field threading#

silk
pub threading: Option<String>

The program-wide threading policy.

Field sanitizers#

silk
pub sanitizers: Option<List<String>>

The enabled sanitizers.

Field unwind#

silk
pub unwind: Option<String>

The unwind policy.

Field backend#

silk
pub backend: Option<String>

The code generator: llvm or direct.

Field codegenUnits#

silk
pub codegenUnits: Option<u64>

The number of code generation units for an optimized build.

Field maxMemory#

silk
pub maxMemory: Option<u64>

The maximum WebAssembly memory, in bytes.

Field stackSize#

silk
pub stackSize: Option<u64>

The main stack size, in bytes.

Implementation Schema for Profile#

silk
impl Schema for Profile

Operation spec#

silk
static fn spec() -> Spec<Profile>

Implementation Profile#

silk
impl Profile

Associated function make#

silk
pub fn make() -> Self

Leaves every setting unspecified so the target supplies its defaults.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page