forked from qt-creator/qt-creator
McuSupport: fix toolchain naming difference between windows and linux
Toolchain naming convention is different in windows "mingw" than in linux "gcc". That caused the logic to fail on windows and prompt the user to remove a kit of an existing target. Task-number: QTCREATORBUG-29003 Change-Id: Ib99a9b38fec30b9a6826874f1acd0bb2f8615e1e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
committed by
Sivert Krøvel
parent
de6ed91c9c
commit
b083a4d55e
@@ -289,8 +289,7 @@ public:
|
|||||||
cMakeToolchainFile.toString().toUtf8());
|
cMakeToolchainFile.toString().toUtf8());
|
||||||
if (!cMakeToolchainFile.exists()) {
|
if (!cMakeToolchainFile.exists()) {
|
||||||
printMessage(
|
printMessage(
|
||||||
Tr::tr(
|
Tr::tr("Warning for target %1: missing CMake toolchain file expected at %2.")
|
||||||
"Warning for target %1: missing CMake toolchain file expected at %2.")
|
|
||||||
.arg(generateKitNameFromTarget(mcuTarget),
|
.arg(generateKitNameFromTarget(mcuTarget),
|
||||||
cMakeToolchainFile.toUserOutput()),
|
cMakeToolchainFile.toUserOutput()),
|
||||||
false);
|
false);
|
||||||
@@ -301,8 +300,7 @@ public:
|
|||||||
"/lib/cmake/Qul/QulGenerators.cmake");
|
"/lib/cmake/Qul/QulGenerators.cmake");
|
||||||
configMap.insert("QUL_GENERATORS", generatorsPath.toString().toUtf8());
|
configMap.insert("QUL_GENERATORS", generatorsPath.toString().toUtf8());
|
||||||
if (!generatorsPath.exists()) {
|
if (!generatorsPath.exists()) {
|
||||||
printMessage(Tr::tr(
|
printMessage(Tr::tr("Warning for target %1: missing QulGenerators expected at %2.")
|
||||||
"Warning for target %1: missing QulGenerators expected at %2.")
|
|
||||||
.arg(generateKitNameFromTarget(mcuTarget),
|
.arg(generateKitNameFromTarget(mcuTarget),
|
||||||
generatorsPath.toUserOutput()),
|
generatorsPath.toUserOutput()),
|
||||||
false);
|
false);
|
||||||
@@ -510,8 +508,7 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
|
|||||||
}
|
}
|
||||||
case McuAbstractPackage::Status::EmptyPath: {
|
case McuAbstractPackage::Status::EmptyPath: {
|
||||||
printMessage(
|
printMessage(
|
||||||
Tr::tr(
|
Tr::tr("Missing %1. Add the path in Edit > Preferences > Devices > MCU.")
|
||||||
"Missing %1. Add the path in Edit > Preferences > Devices > MCU.")
|
|
||||||
.arg(qtForMCUsPackage->detectionPath().toUserOutput()),
|
.arg(qtForMCUsPackage->detectionPath().toUserOutput()),
|
||||||
true);
|
true);
|
||||||
return;
|
return;
|
||||||
@@ -524,9 +521,8 @@ void createAutomaticKits(const SettingsHandler::Ptr &settingsHandler)
|
|||||||
|
|
||||||
if (CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty()) {
|
if (CMakeProjectManager::CMakeToolManager::cmakeTools().isEmpty()) {
|
||||||
printMessage(
|
printMessage(
|
||||||
Tr::tr(
|
Tr::tr("No CMake tool was detected. Add a CMake tool in Edit > Preferences > "
|
||||||
"No CMake tool was detected. Add a CMake tool in Edit > Preferences > "
|
"Kits > CMake."),
|
||||||
"Kits > CMake."),
|
|
||||||
true);
|
true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -744,11 +740,17 @@ static bool anyKitDescriptionFileExists(const FilePaths &jsonFiles,
|
|||||||
const QRegularExpressionMatch match = re.match(jsonFile.fileName());
|
const QRegularExpressionMatch match = re.match(jsonFile.fileName());
|
||||||
QStringList kitsPropertiesFromFileName;
|
QStringList kitsPropertiesFromFileName;
|
||||||
if (match.hasMatch()) {
|
if (match.hasMatch()) {
|
||||||
const QString toolchain = match.captured(1).replace(
|
QString toolchain = match.captured(1);
|
||||||
"gnu", "gcc"); // kitFileName contains gnu while profiles.xml contains gcc
|
|
||||||
const QString vendor = match.captured(2);
|
const QString vendor = match.captured(2);
|
||||||
const QString device = match.captured(3);
|
const QString device = match.captured(3);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* file name of kit starts with "gnu" while in profiles.xml name of
|
||||||
|
* toolchain is "gcc" on Linux and "mingw" on Windows
|
||||||
|
*/
|
||||||
|
toolchain = HostOsInfo::isLinuxHost() ? toolchain.replace("gnu", "gcc")
|
||||||
|
: toolchain.replace("gnu", "mingw");
|
||||||
|
|
||||||
kitsPropertiesFromFileName << toolchain << vendor << device;
|
kitsPropertiesFromFileName << toolchain << vendor << device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user