McuSupport: Make all member fields of McuTarget const

In proactive, the color depth was never changed after setCMakeOptions
was called. This change makes it clear that it is also not intended to
be changed: a board does not suddenly change color depth, and for a new
board configuration a new target is created.

Change-Id: Ie5b99726d833efcdf129655b8e70120a033914e6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Erik Verbruggen
2022-02-07 16:17:35 +01:00
committed by piotr.mucko
parent 52e3f2cd5f
commit 93fc6b5c3c
3 changed files with 31 additions and 21 deletions

View File

@@ -512,9 +512,13 @@ protected:
const auto platform = McuTarget::Platform{ desc.platform.id, desc.platform.name, desc.platform.vendor };
auto mcuTarget = new McuTarget(QVersionNumber::fromString(desc.qulVersion),
platform, os, required3rdPartyPkgs, tcPkg);
if (desc.platform.colorDepths.count() > 1)
mcuTarget->setColorDepth(colorDepth);
platform,
os,
required3rdPartyPkgs,
tcPkg,
desc.platform.colorDepths.count() > 1
? colorDepth
: McuTarget::UnspecifiedColorDepth);
mcuTargets.append(mcuTarget);
}
}
@@ -586,10 +590,13 @@ protected:
required3rdPartyPkgs.append(freeRTOSPkgs.value(desc.freeRTOS.envVar));
}
const auto platform = McuTarget::Platform{ desc.platform.id, desc.platform.name, desc.platform.vendor };
const McuTarget::Platform platform({ desc.platform.id, desc.platform.name, desc.platform.vendor });
auto mcuTarget = new McuTarget(QVersionNumber::fromString(desc.qulVersion),
platform, os, required3rdPartyPkgs, tcPkg);
mcuTarget->setColorDepth(colorDepth);
platform,
os,
required3rdPartyPkgs,
tcPkg,
colorDepth);
mcuTargets.append(mcuTarget);
}
return mcuTargets;