Skip to content

Commit

Permalink
Merge pull request #890 from microsoft/dev/andris/cmake_tools/FixGitH…
Browse files Browse the repository at this point in the history
…ub886_IgnoreVSKitsOnLinux

Fix for issue 886: ignore vs kits processing when not on windows
  • Loading branch information
bobbrow authored Nov 11, 2019
2 parents 9297c3d + 942ef7f commit e053907
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,18 +725,23 @@ export async function scanForClangCLKits(searchPaths: string[]): Promise<Promise
}

async function getVSInstallForKit(kit: Kit): Promise<VSInstallation|undefined> {
console.assert(kit.visualStudio);
console.assert(kit.visualStudioArchitecture);
const installs = await vsInstallations();
const match = (inst: VSInstallation) =>
// old Kit format
(legacyKitVSName(inst) == kit.visualStudio) ||
// new Kit format
(kitVSName(inst) === kit.visualStudio) ||
// Clang for VS kit format
(!!kit.compilers && kit.name.indexOf("Clang") >= 0 && kit.name.indexOf(vsDisplayName(inst)) >= 0);

return installs.find(inst => match(inst));
if (process.platform !== "win32") {
return undefined;
}

console.assert(kit.visualStudio);
console.assert(kit.visualStudioArchitecture);

const installs = await vsInstallations();
const match = (inst: VSInstallation) =>
// old Kit format
(legacyKitVSName(inst) == kit.visualStudio) ||
// new Kit format
(kitVSName(inst) === kit.visualStudio) ||
// Clang for VS kit format
(!!kit.compilers && kit.name.indexOf("Clang") >= 0 && kit.name.indexOf(vsDisplayName(inst)) >= 0);

return installs.find(inst => match(inst));
}

export async function getVSKitEnvironment(kit: Kit): Promise<Map<string, string>|null> {
Expand Down

0 comments on commit e053907

Please sign in to comment.