forked from qt-creator/qt-creator
ProjectExplorer: Auto-detect GNU toolchains provided by AtmelStudio v7
A latest AtmelStudio v7 contains the GNU toolchains in an other directories (against to Atmel Studio v6). This patch takes it into account to detect a provided toolchains. Change-Id: Ife239abca8a513f2fd6652363d1fff049cf16397 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -900,6 +900,9 @@ static Utils::FilePathList atmelSearchPathsFromRegistry()
|
|||||||
|
|
||||||
Utils::FilePathList searchPaths;
|
Utils::FilePathList searchPaths;
|
||||||
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
QSettings registry(kRegistryToken, QSettings::NativeFormat);
|
||||||
|
|
||||||
|
// This code enumerate the installed toolchains provided
|
||||||
|
// by the Atmel Studio v6.x.
|
||||||
const auto toolchainGroups = registry.childGroups();
|
const auto toolchainGroups = registry.childGroups();
|
||||||
for (const QString &toolchainKey : toolchainGroups) {
|
for (const QString &toolchainKey : toolchainGroups) {
|
||||||
if (!toolchainKey.endsWith("GCC"))
|
if (!toolchainKey.endsWith("GCC"))
|
||||||
@@ -936,6 +939,31 @@ static Utils::FilePathList atmelSearchPathsFromRegistry()
|
|||||||
registry.endGroup();
|
registry.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This code enumerate the installed toolchains provided
|
||||||
|
// by the Atmel Studio v7.
|
||||||
|
registry.beginGroup("AtmelStudio");
|
||||||
|
const auto productVersions = registry.childGroups();
|
||||||
|
for (const auto &productVersionKey : productVersions) {
|
||||||
|
registry.beginGroup(productVersionKey);
|
||||||
|
const QString installDir = registry.value("InstallDir").toString();
|
||||||
|
registry.endGroup();
|
||||||
|
|
||||||
|
const QStringList knownToolchainSubdirs = {
|
||||||
|
"/toolchain/arm/arm-gnu-toolchain/bin/",
|
||||||
|
"/toolchain/avr8/avr8-gnu-toolchain/bin/",
|
||||||
|
"/toolchain/avr32/avr32-gnu-toolchain/bin/",
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const auto &subdir : knownToolchainSubdirs) {
|
||||||
|
const QString toolchainPath = installDir + subdir;
|
||||||
|
const FilePath path = FilePath::fromString(toolchainPath);
|
||||||
|
if (!path.exists())
|
||||||
|
continue;
|
||||||
|
searchPaths.push_back(path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
registry.endGroup();
|
||||||
|
|
||||||
return searchPaths;
|
return searchPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user