forked from qt-creator/qt-creator
McuSupport: IAR compiler registration
Autodetection of IAR compiler relies on Windows Registry. On Linux, without registry we can't autodetect it. This fallback accepts the user-entered compiler path. The McuSupport plugin already implements a basic check that the expected compiler binary is in the given path. Task-number: QTCREATORBUG-26753 Change-Id: I43ce68f4bc075e60a2f4cd0d906f8389dc0fdfd7 Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -427,7 +427,7 @@ static ToolChain *armGccToolChain(const FilePath &path, Id language)
|
||||
return toolChain;
|
||||
}
|
||||
|
||||
static ToolChain *iarToolChain(Id language)
|
||||
static ToolChain *iarToolChain(const FilePath &path, Id language)
|
||||
{
|
||||
ToolChain *toolChain = ToolChainManager::toolChain([language](const ToolChain *t){
|
||||
return t->typeId() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID
|
||||
@@ -439,7 +439,9 @@ static ToolChain *iarToolChain(Id language)
|
||||
return f->supportedToolChainType() == BareMetal::Constants::IAREW_TOOLCHAIN_TYPEID;
|
||||
});
|
||||
if (iarFactory) {
|
||||
const QList<ToolChain*> detected = iarFactory->autoDetect({}, {});
|
||||
QList<ToolChain*> detected = iarFactory->autoDetect({}, {});
|
||||
if (detected.isEmpty())
|
||||
detected = iarFactory->detectForImport({path, language});
|
||||
for (auto tc: detected) {
|
||||
if (tc->language() == language) {
|
||||
toolChain = tc;
|
||||
@@ -462,7 +464,8 @@ ToolChain *McuToolChainPackage::toolChain(Id language) const
|
||||
else if (m_type == TypeGCC)
|
||||
tc = gccToolChain(language);
|
||||
else if (m_type == TypeIAR) {
|
||||
tc = iarToolChain(language);
|
||||
const FilePath compiler = path().pathAppended("/bin/iccarm").withExecutableSuffix();
|
||||
tc = iarToolChain(compiler, language);
|
||||
}
|
||||
else {
|
||||
const QLatin1String compilerName(
|
||||
|
||||
Reference in New Issue
Block a user