You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using the CMake Tools extension with the Visual Studio generator for some time without issue. I swapped to using Ninja and was struggling with it using the wrong compiler. After enabling debug logging I found that this was because the environment variables from vcvaralls.bat were not being applied. I had to debug the vscode-cmake-tools extension to work out that the reason why was that at some point my VS Install instance ID had changed so my cmake-tools-kits.json was outdated. Running Scan for Kit updated the instance ID which fixed the issue.
It would be good if there were some kind of warning or error message when the VS instance was not found, and perhaps a suggestion to re-scan for kits:
export async function getVSKitEnvironment(kit: Kit): Promise<Environment | null> {
const requested = await getVSInstallForKit(kit);
if (!requested) {
return null;
}
return varsForVSInstallation(requested, kit.visualStudioArchitecture!, kit.preferredGenerator?.platform);
}
async function getVSInstallForKit(kit: Kit): Promise<VSInstallation | undefined> {
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(match);
}
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Brief Issue Summary
I've been using the CMake Tools extension with the Visual Studio generator for some time without issue. I swapped to using Ninja and was struggling with it using the wrong compiler. After enabling debug logging I found that this was because the environment variables from vcvaralls.bat were not being applied. I had to debug the vscode-cmake-tools extension to work out that the reason why was that at some point my VS Install instance ID had changed so my cmake-tools-kits.json was outdated. Running Scan for Kit updated the instance ID which fixed the issue.
It would be good if there were some kind of warning or error message when the VS instance was not found, and perhaps a suggestion to re-scan for kits:
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: