forked from qt-creator/qt-creator
CMakePM: Remove remainders of extraGenerator
It was not possible to set the toolset for Visual Studio 2022 generator.
Amends 4f26d802ca
Change-Id: I56caf9c0d66812eb599646a3679602af7372f419
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -503,11 +503,9 @@ class GeneratorInfo
|
|||||||
public:
|
public:
|
||||||
GeneratorInfo() = default;
|
GeneratorInfo() = default;
|
||||||
GeneratorInfo(const QString &generator_,
|
GeneratorInfo(const QString &generator_,
|
||||||
const QString &extraGenerator_ = QString(),
|
|
||||||
const QString &platform_ = QString(),
|
const QString &platform_ = QString(),
|
||||||
const QString &toolset_ = QString())
|
const QString &toolset_ = QString())
|
||||||
: generator(generator_)
|
: generator(generator_)
|
||||||
, extraGenerator(extraGenerator_)
|
|
||||||
, platform(platform_)
|
, platform(platform_)
|
||||||
, toolset(toolset_)
|
, toolset(toolset_)
|
||||||
{}
|
{}
|
||||||
@@ -747,7 +745,7 @@ Tasks CMakeGeneratorKitAspectFactory::validate(const Kit *k) const
|
|||||||
const GeneratorInfo info = generatorInfo(k);
|
const GeneratorInfo info = generatorInfo(k);
|
||||||
QList<CMakeTool::Generator> known = tool->supportedGenerators();
|
QList<CMakeTool::Generator> known = tool->supportedGenerators();
|
||||||
auto it = std::find_if(known.constBegin(), known.constEnd(), [info](const CMakeTool::Generator &g) {
|
auto it = std::find_if(known.constBegin(), known.constEnd(), [info](const CMakeTool::Generator &g) {
|
||||||
return g.matches(info.generator, info.extraGenerator);
|
return g.matches(info.generator);
|
||||||
});
|
});
|
||||||
if (it == known.constEnd()) {
|
if (it == known.constEnd()) {
|
||||||
addWarning(Tr::tr("CMake Tool does not support the configured generator."));
|
addWarning(Tr::tr("CMake Tool does not support the configured generator."));
|
||||||
@@ -786,7 +784,7 @@ void CMakeGeneratorKitAspectFactory::fix(Kit *k)
|
|||||||
QList<CMakeTool::Generator> known = tool->supportedGenerators();
|
QList<CMakeTool::Generator> known = tool->supportedGenerators();
|
||||||
auto it = std::find_if(known.constBegin(), known.constEnd(),
|
auto it = std::find_if(known.constBegin(), known.constEnd(),
|
||||||
[info](const CMakeTool::Generator &g) {
|
[info](const CMakeTool::Generator &g) {
|
||||||
return g.matches(info.generator, info.extraGenerator);
|
return g.matches(info.generator);
|
||||||
});
|
});
|
||||||
if (it == known.constEnd()) {
|
if (it == known.constEnd()) {
|
||||||
GeneratorInfo dv;
|
GeneratorInfo dv;
|
||||||
@@ -794,7 +792,6 @@ void CMakeGeneratorKitAspectFactory::fix(Kit *k)
|
|||||||
setGeneratorInfo(k, dv);
|
setGeneratorInfo(k, dv);
|
||||||
} else {
|
} else {
|
||||||
const GeneratorInfo dv(isIos(k) ? QString("Xcode") : info.generator,
|
const GeneratorInfo dv(isIos(k) ? QString("Xcode") : info.generator,
|
||||||
info.extraGenerator,
|
|
||||||
it->supportsPlatform ? info.platform : QString(),
|
it->supportsPlatform ? info.platform : QString(),
|
||||||
it->supportsToolset ? info.toolset : QString());
|
it->supportsToolset ? info.toolset : QString());
|
||||||
setGeneratorInfo(k, dv);
|
setGeneratorInfo(k, dv);
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ const char CMAKE_INFORMATION_AUTODETECTED[] = "AutoDetected";
|
|||||||
const char CMAKE_INFORMATION_DETECTIONSOURCE[] = "DetectionSource";
|
const char CMAKE_INFORMATION_DETECTIONSOURCE[] = "DetectionSource";
|
||||||
const char CMAKE_INFORMATION_READERTYPE[] = "ReaderType";
|
const char CMAKE_INFORMATION_READERTYPE[] = "ReaderType";
|
||||||
|
|
||||||
bool CMakeTool::Generator::matches(const QString &n, const QString &ex) const
|
bool CMakeTool::Generator::matches(const QString &n) const
|
||||||
{
|
{
|
||||||
return n == name && (ex.isEmpty() || extraGenerators.contains(ex));
|
return n == name;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public:
|
|||||||
bool supportsPlatform = true;
|
bool supportsPlatform = true;
|
||||||
bool supportsToolset = true;
|
bool supportsToolset = true;
|
||||||
|
|
||||||
bool matches(const QString &n, const QString &ex = QString()) const;
|
bool matches(const QString &n) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
using PathMapper = std::function<Utils::FilePath (const Utils::FilePath &)>;
|
using PathMapper = std::function<Utils::FilePath (const Utils::FilePath &)>;
|
||||||
|
|||||||
Reference in New Issue
Block a user