review feedback: add comments and use local flavor variable

This commit is contained in:
Martin Finkel 2019-08-13 11:11:35 +02:00
parent c9da160aad
commit 1581c43be0

View File

@ -159,8 +159,11 @@ pub fn get_linker(sess: &Session, linker: &Path, flavor: LinkerFlavor) -> (PathB
}
};
// UWP apps have API restrictions enforced during Store submissions.
// To comply with the Windows App Certification Kit,
// MSVC needs to link with the Store versions of the runtime libraries (vcruntime, msvcrt, etc).
let t = &sess.target.target;
if t.linker_flavor == LinkerFlavor::Msvc && t.target_vendor == "uwp" {
if flavor == LinkerFlavor::Msvc && t.target_vendor == "uwp" {
if let Some(ref tool) = msvc_tool {
let original_path = tool.path();
if let Some(ref root_lib_path) = original_path.ancestors().skip(4).next() {