module battery.detect.msvc
Detect Visual Studio installations.
Code Map
//! Detect Visual Studio installations.
module battery.detect.msvc;
//! An enumeration of supported Visual Studio versions.
enum VisualStudioVersion
{
//! An unsupported Visual Studio version.
Unknown,
//! Visual Studio 2015 (AKA v14)
V2015,
//! Visual Studio 2017 (AKA v15)
V2017,
MaxVersion,
}
//! From environment.
struct FromEnv
{
public:
vcInstallDir: string;
vcToolsInstallDir: string;
universalCrtDir: string;
universalCrtVersion: string;
windowsSdkDir: string;
windowsSdkVersion: string;
}
//! Contains information on a particular Visual Studio installation.
struct Result
{
public:
//! The version of this installation.
ver: VisualStudioVersion;
//! How was this MSVC found?
from: string;
//! The installation path of VC.
vcInstallDir: string;
//! The path to the Windows SDK.
windowsSdkDir: string;
//! The Windows SDK version.
windowsSdkVersion: string;
//! The path to the Universal CRT.
universalCrtDir: string;
//! The Universal CRT version.
universalCrtVersion: string;
//! The cl.exe command.
clCmd: string;
//! The link.exe command.
linkCmd: string;
}
//! Return a simple string that corresponds with a VisualStudioVersion
fn visualStudioVersionToString(ver: VisualStudioVersion) string { }
//! Returns a list of supported Visual Studio installations.
fn detect(fromEnv: FromEnv, results: Result[]) bool { }
enum VisualStudioVersion
An enumeration of supported Visual Studio versions.
enum Unknown
An unsupported Visual Studio version.
enum V2015
Visual Studio 2015 (AKA v14)
enum V2017
Visual Studio 2017 (AKA v15)
struct FromEnv
From environment.
struct Result
Contains information on a particular Visual Studio installation.
ver: VisualStudioVersion
The version of this installation.
from: string
How was this MSVC found?
vcInstallDir: string
The installation path of VC.
windowsSdkDir: string
The path to the Windows SDK.
windowsSdkVersion: string
The Windows SDK version.
universalCrtDir: string
The path to the Universal CRT.
universalCrtVersion: string
The Universal CRT version.
clCmd: string
The cl.exe command.
linkCmd: string
The link.exe command.
fn visualStudioVersionToString(ver: VisualStudioVersion) string
Return a simple string that corresponds with a VisualStudioVersion
fn detect(fromEnv: FromEnv, results: Result[]) bool
Returns a list of supported Visual Studio installations.
Only returns supported versions. Only works on 64 bit systems. An installation is only considered valid if VC is installed.