diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2019-07-15 17:43:48 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2019-07-16 12:50:22 +0000 |
commit | 56dc926b9d8d97439c96a7b5db581621431207b5 (patch) | |
tree | 83f7967452287692c0b5c91badbaa17ac99a11c1 | |
parent | 9146d5bd3a4a8546732d2c8c069fb5480c5678c7 (diff) |
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>
-rw-r--r-- | src/plugins/projectexplorer/gcctoolchain.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index a0a9583e6f..8d749ea79a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -900,6 +900,9 @@ static Utils::FilePathList atmelSearchPathsFromRegistry() Utils::FilePathList searchPaths; QSettings registry(kRegistryToken, QSettings::NativeFormat); + + // This code enumerate the installed toolchains provided + // by the Atmel Studio v6.x. const auto toolchainGroups = registry.childGroups(); for (const QString &toolchainKey : toolchainGroups) { if (!toolchainKey.endsWith("GCC")) @@ -936,6 +939,31 @@ static Utils::FilePathList atmelSearchPathsFromRegistry() 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; } |