Skip to content

Commit

Permalink
Drop support for Visual Studio 12 (2013)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaoliello committed May 1, 2024
1 parent 2c85112 commit b2bed0b
Showing 1 changed file with 6 additions and 34 deletions.
40 changes: 6 additions & 34 deletions src/windows/find_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ pub fn find_tool(target: &str, tool: &str) -> Option<Tool> {
impl_::find_msvc_environment(tool, target)
.or_else(|| impl_::find_msvc_15plus(tool, target))
.or_else(|| impl_::find_msvc_14(tool, target))
.or_else(|| impl_::find_msvc_12(tool, target))
}

/// A version of Visual Studio
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
#[non_exhaustive]
pub enum VsVers {
/// Visual Studio 12 (2013)
#[deprecated(
note = "Visual Studio 12 is no longer supported. cc will never return this value."
)]
Vs12,
/// Visual Studio 14 (2015)
Vs14,
Expand All @@ -117,7 +119,6 @@ pub fn find_vs_version() -> Result<VsVers, String> {
"16.0" => Ok(VsVers::Vs16),
"15.0" => Ok(VsVers::Vs15),
"14.0" => Ok(VsVers::Vs14),
"12.0" => Ok(VsVers::Vs12),
vers => Err(format!(
"\n\n\
unsupported or unknown VisualStudio version: {}\n\
Expand All @@ -139,8 +140,6 @@ pub fn find_vs_version() -> Result<VsVers, String> {
Ok(VsVers::Vs15)
} else if impl_::has_msbuild_version("14.0") {
Ok(VsVers::Vs14)
} else if impl_::has_msbuild_version("12.0") {
Ok(VsVers::Vs12)
} else {
Err(format!(
"\n\n\
Expand Down Expand Up @@ -695,22 +694,6 @@ mod impl_ {
Some(())
}

// For MSVC 12 we need to find the Windows 8.1 SDK.
pub(super) fn find_msvc_12(tool: &str, target: TargetArch<'_>) -> Option<Tool> {
let vcdir = get_vc_dir("12.0")?;
let mut tool = get_tool(tool, &vcdir, target)?;
let sub = lib_subdir(target)?;
let sdk81 = get_sdk81_dir()?;
tool.path.push(sdk81.join("bin").join(sub));
let sdk_lib = sdk81.join("lib").join("winv6.3");
tool.libs.push(sdk_lib.join("um").join(sub));
let sdk_include = sdk81.join("include");
tool.include.push(sdk_include.join("shared"));
tool.include.push(sdk_include.join("um"));
tool.include.push(sdk_include.join("winrt"));
Some(tool.into_tool())
}

fn add_env(tool: &mut Tool, env: &str, paths: Vec<PathBuf>) {
let prev = env::var_os(env).unwrap_or(OsString::new());
let prev = env::split_paths(&prev);
Expand Down Expand Up @@ -960,7 +943,7 @@ mod impl_ {
|| find_msbuild_vs15(TargetArch("i686")).is_some()
|| find_msbuild_vs15(TargetArch("aarch64")).is_some()
}
"12.0" | "14.0" => LOCAL_MACHINE
"14.0" => LOCAL_MACHINE
.open(&OsString::from(format!(
"SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\{}",
version
Expand Down Expand Up @@ -1067,18 +1050,7 @@ mod impl_ {
None
}

// For MSVC 12 we need to find the Windows 8.1 SDK.
pub(super) fn find_msvc_12(_tool: &str, _target: TargetArch<'_>) -> Option<Tool> {
None
}

pub(super) fn has_msbuild_version(version: &str) -> bool {
match version {
"17.0" => false,
"16.0" => false,
"15.0" => false,
"12.0" | "14.0" => false,
_ => false,
}
pub(super) fn has_msbuild_version(_version: &str) -> bool {
false
}
}

0 comments on commit b2bed0b

Please sign in to comment.