forked from qt-creator/qt-creator
McuSupport: Fix version detection for GHS toolchains
The GHS compiler invoked without a valid input source file returns an error code. Use gversion instead, a utility part of the toolchain, with -help to retrieve the version string. Change-Id: I289f462d322db045368cfb5a02b6644838559639 Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -276,8 +276,8 @@ McuToolChainPackagePtr createGhsToolchainPackage(const SettingsHandler::Ptr &set
|
||||
const FilePath defaultPath = FilePath::fromUserInput(qtcEnvironmentVariable(envVar));
|
||||
|
||||
const auto *versionDetector
|
||||
= new McuPackageExecutableVersionDetector(FilePath("as850").withExecutableSuffix(),
|
||||
{"-V"},
|
||||
= new McuPackageExecutableVersionDetector(FilePath("gversion").withExecutableSuffix(),
|
||||
{"-help"},
|
||||
R"(\bv(\d+\.\d+\.\d+)\b)");
|
||||
|
||||
return McuToolChainPackagePtr{
|
||||
@@ -301,8 +301,8 @@ McuToolChainPackagePtr createGhsArmToolchainPackage(const SettingsHandler::Ptr &
|
||||
const FilePath defaultPath = FilePath::fromUserInput(qtcEnvironmentVariable(envVar));
|
||||
|
||||
const auto *versionDetector
|
||||
= new McuPackageExecutableVersionDetector(FilePath("asarm").withExecutableSuffix(),
|
||||
{"-V"},
|
||||
= new McuPackageExecutableVersionDetector(FilePath("gversion").withExecutableSuffix(),
|
||||
{"-help"},
|
||||
R"(\bv(\d+\.\d+\.\d+)\b)");
|
||||
|
||||
return McuToolChainPackagePtr{
|
||||
|
||||
Reference in New Issue
Block a user