module battery.defines

Common enums and classes, aka "defines".

Code Map

//! Common enums and classes, aka "defines".
module battery.defines;


//! Each of these listed platforms corresponds to a Version identifier.
enum Platform
{
	//! Windows and MSVC compatible.
	MSVC,
	//! Linux.
	Linux,
	//! Apple OSX
	OSX,
	//! Bare Metal
	Metal,
}

//! Each of these listed architectures corresponds to a Version
//! identifier.
enum Arch
{
	//! X86 32 Bit
	X86,
	//! X86 64 Bit aka AMD64.
	X86_64,
	//! armv7-a, ARMHF.
	ARMHF,
	//! AArch64, ARM64.
	AArch64,
}

//! What kind of linker is being used, selects arguments.
enum LinkerKind
{
	//! Internal error state.
	Invalid,
	//! MSVC
	Link,
	//! LLVM Clang
	Clang,
}

//! What kind of C-compiler is being used, selects arguments.
enum CCKind
{
	//! Internal error state.
	Invalid,
	//! LLVM Clang
	Clang,
}

//! Tracking if a configuration is native, host or cross-compile.
enum ConfigKind
{
	//! Internal error state.
	Invalid,
	//! For boostraping the volted binary.
	Bootstrap,
	//! Target is the same as the host system.
	Native,
	//! For cross-compile, this config is the host system.
	Host,
	//! For cross-compile, this is the target config.
	Cross,
}

//! Represents a single command that can be launched.
class Command
{
public:
	//! Textual name.
	name: string;
	//! Name and path.
	cmd: string;
	//! Extra args to give when invoking.
	args: string[];
	//! Name to print.
	print: string;


public:
	this() { }
	this(cmd: string, args: string[]) { }
	this(name: string, c: Command) { }
}

//! A struct holding information from a battery.conf.toml file.
struct BatteryConfig
{
public:
	filename: string;
	voltaCmd: string;
	nasmCmd: string;
	gdcCmd: string;
	rdmdCmd: string;
	pkgs: string[];
	llvmConfigCmd: string;
	llvmArCmd: string;
	llvmClangCmd: string;
	llvmLinkCmd: string;
	llvmWasmCmd: string;
	llvmC: string;
}
enum Platform

Each of these listed platforms corresponds to a Version identifier.

Posix and Windows are not listed here as they they are available on multiple platforms.

Posix on Linux and OSX. Windows on MinGW and MSVC.

enum MSVC

Windows and MSVC compatible.

enum Linux

Linux.

enum OSX

Apple OSX

enum Metal

Bare Metal

enum Arch

Each of these listed architectures corresponds to a Version identifier.

enum X86

X86 32 Bit

enum X86_64

X86 64 Bit aka AMD64.

enum ARMHF

armv7-a, ARMHF.

enum AArch64

AArch64, ARM64.

enum LinkerKind

What kind of linker is being used, selects arguments.

enum Invalid

Internal error state.

enum Link

MSVC

enum Clang

LLVM Clang

enum CCKind

What kind of C-compiler is being used, selects arguments.

enum Invalid

Internal error state.

enum Clang

LLVM Clang

enum ConfigKind

Tracking if a configuration is native, host or cross-compile.

enum Invalid

Internal error state.

enum Bootstrap

For boostraping the volted binary.

enum Native

Target is the same as the host system.

enum Host

For cross-compile, this config is the host system.

enum Cross

For cross-compile, this is the target config.

class Command

Represents a single command that can be launched.

name: string

Textual name.

cmd: string

Name and path.

args: string[]

Extra args to give when invoking.

print: string

Name to print.

struct BatteryConfig

A struct holding information from a battery.conf.toml file.