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;
}
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.
Windows and MSVC compatible.
Linux.
Apple OSX
Bare Metal
Each of these listed architectures corresponds to a Version identifier.
X86 32 Bit
X86 64 Bit aka AMD64.
armv7-a, ARMHF.
AArch64, ARM64.
What kind of linker is being used, selects arguments.
Internal error state.
MSVC
LLVM Clang
What kind of C-compiler is being used, selects arguments.
Internal error state.
LLVM Clang
Tracking if a configuration is native, host or cross-compile.
Internal error state.
For boostraping the volted binary.
Target is the same as the host system.
For cross-compile, this config is the host system.
For cross-compile, this is the target config.
Represents a single command that can be launched.
Textual name.
Name and path.
Extra args to give when invoking.
Name to print.
A struct holding information from a battery.conf.toml file.