module battery.configuration

Contians the per build configuration.

Code Map

//! Contians the per build configuration.
module battery.configuration;

public import battery.defines;
public import battery.commonInterfaces;


//! A build configuration for one or more builds.
class Configuration
{
public:
	//! Used when launching commands.
	env: Environment;
	//! Is this, native, host or cross-compile?
	kind: ConfigKind;
	//! Architecture for this configuration.
	arch: Arch;
	//! Platform for this configuration.
	platform: Platform;
	//! Is the build release or debug.
	isRelease: bool;
	//! Link-time-optimizations, implemented via LLVM's ThinLTO.
	isLTO: bool;
	//! Should we generate vdoc json files.
	shouldJSON: bool;
	//! The llvmConf path, given by --llvmconf.
	llvmConf: string;
	//! The battery config file that might be loaded.
	batConf: BatteryConfig;
	//! LLVM version.
	llvmVersion: semver.Release;
	//! Base clang command.
	clangCmd: Command;
	//! Linker command.
	linkerCmd: Command;
	//! Linker command.
	linkerKind: LinkerKind;
	//! C-compiler.
	ccCmd: Command;
	//! C-compiler.
	ccKind: CCKind;
	//! NASM used for rt assembly files.
	nasmCmd: Command;
	//! Rdmd for bootstrapping.
	rdmdCmd: Command;
	//! Gdc for bootstrapping.
	gdcCmd: Command;
	//! All added tools.
	tools: Command[string];


public:
	this() { }
	//! Get a tool that has been added.
	fn getTool(name: string) Command { }
	//! Adds a tool to this configuration, a given tool can only be added once.
	fn addTool(name: string, cmd: string, args: string[]) Command { }
	//! Helper properties.
	fn isBootstrap() bool { }
	//! Helper properties.
	fn isNative() bool { }
	//! Helper properties.
	fn isCross() bool { }
}
class Configuration

A build configuration for one or more builds.

This can be shared between multiple builds. When cross-compiling there will be multiple configurations, one for the target and another for the host.

env: Environment

Used when launching commands.

kind: ConfigKind

Is this, native, host or cross-compile?

arch: Arch

Architecture for this configuration.

platform: Platform

Platform for this configuration.

isRelease: bool

Is the build release or debug.

isLTO: bool

Link-time-optimizations, implemented via LLVM's ThinLTO.

shouldJSON: bool

Should we generate vdoc json files.

llvmConf: string

The llvmConf path, given by --llvmconf.

batConf: BatteryConfig

The battery config file that might be loaded.

llvmVersion: semver.Release

LLVM version.

clangCmd: Command

Base clang command.

linkerCmd: Command

Linker command.

linkerKind: LinkerKind

Linker command.

ccCmd: Command

C-compiler.

ccKind: CCKind

C-compiler.

nasmCmd: Command

NASM used for rt assembly files.

rdmdCmd: Command

Rdmd for bootstrapping.

gdcCmd: Command

Gdc for bootstrapping.

tools: Command[string]

All added tools.

fn getTool(name: string) Command

Get a tool that has been added.

fn addTool(name: string, cmd: string, args: string[]) Command

Adds a tool to this configuration, a given tool can only be added once.

fn isBootstrap() bool

Helper properties.

fn isNative() bool

Helper properties.

fn isCross() bool

Helper properties.