Skip to content

Commit

Permalink
Kit: Only use Kits generated by cmake extension as templates
Browse files Browse the repository at this point in the history
Since our Kits are mixed in with the cmake-extension generated kits
we need to filter them out so we don't use them as templates.

Without this patch the kit-generator would try to create new Qt Kits
using the previously created kits as templates.

Change-Id: If945b5edfa7eba9a9ea08282f238d91e7744f691
Reviewed-by: Marcus Tillmanns <[email protected]>
  • Loading branch information
OrkunTokdemir committed May 28, 2024
1 parent c6c55b2 commit ed54555
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/kit-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,24 @@ export class KitManager {
qtFolder: string,
qtInstallations: string[]
) {
const loadedCMakeKits = await KitManager.loadCMakeKitsFileJSON();
const allCMakeKits = await KitManager.loadCMakeKitsFileJSON();
logger.info(`qtFolder: "${qtFolder}"`);
logger.info(`Loaded CMake kits: ${JSON.stringify(loadedCMakeKits)}`);
logger.info(`Loaded CMake kits: ${JSON.stringify(allCMakeKits)}`);
// Filter out kits generated by us, since we only want to use Kits
// that were created by the cmake extension as templates.
const kitsFromCMakeExtension = allCMakeKits.filter(
(kit) => kit.environmentVariables?.VSCODE_QT_FOLDER === undefined
);
logger.info(
`Kits from CMake extension: ${JSON.stringify(kitsFromCMakeExtension)}`
);
logger.info(`Qt installations: ${JSON.stringify(qtInstallations)}`);
const kits = [];
for (const installation of qtInstallations)
for await (const kit of KitManager.generateCMakeKitsOfQtInstallationPath(
qtFolder,
installation,
loadedCMakeKits
kitsFromCMakeExtension
))
kits.push(kit);
return kits;
Expand Down

0 comments on commit ed54555

Please sign in to comment.