Skip to content

Commit 9c556d8

Browse files
dpaolielloNobodyXu
andauthored
Drop support for Visual Studio 12 (2013) (#1046)
* Drop support for Visual Studio 12 (2013) * Fix clippy lint Signed-off-by: Jiahao XU <[email protected]> --------- Signed-off-by: Jiahao XU <[email protected]> Co-authored-by: Jiahao XU <[email protected]>
1 parent f657ba1 commit 9c556d8

File tree

1 file changed

+7
-44
lines changed

1 file changed

+7
-44
lines changed

Diff for: src/windows/find_tools.rs

+7-44
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,16 @@ pub(crate) fn find_tool_inner(
146146
impl_::find_msvc_environment(tool, target, env_getter)
147147
.or_else(|| impl_::find_msvc_15plus(tool, target, env_getter))
148148
.or_else(|| impl_::find_msvc_14(tool, target, env_getter))
149-
.or_else(|| impl_::find_msvc_12(tool, target, env_getter))
150149
}
151150

152151
/// A version of Visual Studio
153152
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
154153
#[non_exhaustive]
155154
pub enum VsVers {
156155
/// Visual Studio 12 (2013)
156+
#[deprecated(
157+
note = "Visual Studio 12 is no longer supported. cc will never return this value."
158+
)]
157159
Vs12,
158160
/// Visual Studio 14 (2015)
159161
Vs14,
@@ -181,7 +183,6 @@ pub fn find_vs_version() -> Result<VsVers, String> {
181183
"16.0" => Ok(VsVers::Vs16),
182184
"15.0" => Ok(VsVers::Vs15),
183185
"14.0" => Ok(VsVers::Vs14),
184-
"12.0" => Ok(VsVers::Vs12),
185186
vers => Err(format!(
186187
"\n\n\
187188
unsupported or unknown VisualStudio version: {}\n\
@@ -203,8 +204,6 @@ pub fn find_vs_version() -> Result<VsVers, String> {
203204
Ok(VsVers::Vs15)
204205
} else if has_msbuild_version("14.0") {
205206
Ok(VsVers::Vs14)
206-
} else if has_msbuild_version("12.0") {
207-
Ok(VsVers::Vs12)
208207
} else {
209208
Err("\n\n\
210209
couldn't determine visual studio generator\n\
@@ -257,7 +256,7 @@ mod impl_ {
257256
impl LibraryHandle {
258257
fn new(name: &[u8]) -> Option<Self> {
259258
let handle = unsafe { LoadLibraryA(name.as_ptr() as _) };
260-
(!handle.is_null()).then(|| Self(handle))
259+
(!handle.is_null()).then_some(Self(handle))
261260
}
262261

263262
/// Get a function pointer to a function in the library.
@@ -786,26 +785,6 @@ mod impl_ {
786785
Some(())
787786
}
788787

789-
// For MSVC 12 we need to find the Windows 8.1 SDK.
790-
pub(super) fn find_msvc_12(
791-
tool: &str,
792-
target: TargetArch<'_>,
793-
env_getter: &dyn EnvGetter,
794-
) -> Option<Tool> {
795-
let vcdir = get_vc_dir("12.0")?;
796-
let mut tool = get_tool(tool, &vcdir, target)?;
797-
let sub = lib_subdir(target)?;
798-
let sdk81 = get_sdk81_dir()?;
799-
tool.path.push(sdk81.join("bin").join(sub));
800-
let sdk_lib = sdk81.join("lib").join("winv6.3");
801-
tool.libs.push(sdk_lib.join("um").join(sub));
802-
let sdk_include = sdk81.join("include");
803-
tool.include.push(sdk_include.join("shared"));
804-
tool.include.push(sdk_include.join("um"));
805-
tool.include.push(sdk_include.join("winrt"));
806-
Some(tool.into_tool(env_getter))
807-
}
808-
809788
fn add_env(
810789
tool: &mut Tool,
811790
env: &'static str,
@@ -1069,7 +1048,7 @@ mod impl_ {
10691048
|| find_msbuild_vs15(TargetArch("i686"), env_getter).is_some()
10701049
|| find_msbuild_vs15(TargetArch("aarch64"), env_getter).is_some()
10711050
}
1072-
"12.0" | "14.0" => LOCAL_MACHINE
1051+
"14.0" => LOCAL_MACHINE
10731052
.open(&OsString::from(format!(
10741053
"SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\{}",
10751054
version
@@ -1198,24 +1177,8 @@ mod impl_ {
11981177
None
11991178
}
12001179

1201-
// For MSVC 12 we need to find the Windows 8.1 SDK.
1202-
#[inline(always)]
1203-
pub(super) fn find_msvc_12(
1204-
_tool: &str,
1205-
_target: TargetArch<'_>,
1206-
_: &dyn EnvGetter,
1207-
) -> Option<Tool> {
1208-
None
1209-
}
1210-
12111180
#[inline(always)]
1212-
pub(super) fn has_msbuild_version(version: &str, _: &dyn EnvGetter) -> bool {
1213-
match version {
1214-
"17.0" => false,
1215-
"16.0" => false,
1216-
"15.0" => false,
1217-
"12.0" | "14.0" => false,
1218-
_ => false,
1219-
}
1181+
pub(super) fn has_msbuild_version(_version: &str, _: &dyn EnvGetter) -> bool {
1182+
false
12201183
}
12211184
}

0 commit comments

Comments
 (0)