module battery.policy.config

Logic for setting up configs.

Code Map

//! Logic for setting up configs.
module battery.policy.config;


enum UseAsLinker
{
	NO,
	YES,
}

struct VarsForMSVC
{
public:
	//! Old INCLUDE env variable, if found.
	oldInc: string;
	//! Old LIB env variable, if found.
	oldLib: string;
	//! Old PATH env variable, if found.
	oldPath: string;
	//! Best guess which MSVC thing we are using.
	msvcVer: msvc.VisualStudioVersion;
	//! How was this MSVC found?
	from: string;
	//! The cl.exe for this specific MSVC version.
	clCmd: string;
	//! The link.exe for this specific MSVC version.
	linkCmd: string;
	//! Install directory for compiler and linker, from either
	//! VCTOOLSINSTALLDIR or VCINSTALLDIR env.
	dirVCInstall: string;
	dirUCRT: string;
	dirWinSDK: string;
	numUCRT: string;
	numWinSDK: string;
	//! Include directories, derived from the above fields.
	inc: string[];
	//! Library directories, derived from the above fields.
	lib: string[];
	//! Extra path, for binaries.
	path: string[];


public:
	fn tPath(dir: string) { }
	fn tInc(dir: string) { }
	fn tLib(dir: string) { }
}

//! So we get the right prefix on logged messages.
global log: battery.util.log.Logger;

fn getProjectConfig(drv: Driver, arch: Arch, platform: Platform) Configuration { }
fn doConfig(drv: Driver, config: Configuration) { }
fn doEnv(drv: Driver, config: Configuration, outside: Environment) { }
fn logNeeded(need: llvm.Needed, config: Configuration) { }
fn fillInNeeded(need: llvm.Needed, config: Configuration) { }
fn logMissingNeeded(res: llvm.Result, cmd: string) { }
fn hasNeeded(res: llvm.Result, need: llvm.Needed) bool { }
fn pickLLVM(drv: Driver, config: Configuration, need: llvm.Needed, result: llvm.Result) bool { }
fn doToolChainLLVM(drv: Driver, config: Configuration, useLinker: UseAsLinker) { }
fn doToolChainNativeMSVC(drv: Driver, config: Configuration, outside: Environment) { }
fn doToolChainCrossMSVC(drv: Driver, config: Configuration, outside: Environment) { }
fn getMSVCInfo(vars: VarsForMSVC, drv: Driver, env: Environment) { }
fn fillInListsForMSVC(vars: VarsForMSVC) { }
fn diffVars(drv: Driver, l: VarsForMSVC, r: VarsForMSVC) { }
//! Used to compare INCLUDE and LIB env vars, badly deals with case
//! sensitivity.
fn compareOldAndNew(oldPath: string, newPath: string) bool { }
fn genAndCheckEnv(vars: VarsForMSVC, drv: Driver, inc: string, lib: string, path: string) { }
fn addCommonLinkerArgsMSVC(config: Configuration, linker: Command) { }
fn doGDC(drv: Driver, config: Configuration) bool { }
fn doRDMD(drv: Driver, config: Configuration) bool { }
fn doNASM(drv: Driver, config: Configuration) bool { }
fn doVolta(drv: Driver, config: Configuration) bool { }
fn fillInConfigCommands(drv: Driver, config: Configuration) { }
fn makeCommandFromPath(config: Configuration, cmd: string, name: string) Command { }
fn fillIfFound(drv: Driver, config: Configuration, name: string, cmd: string, args: string[]) { }
global log: battery.util.log.Logger

So we get the right prefix on logged messages.

fn compareOldAndNew(oldPath: string, newPath: string) bool

Used to compare INCLUDE and LIB env vars, badly deals with case sensitivity.