forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.14'
Change-Id: Iea84f23cf394de13e99a9ed777c8c113e4eff473
This commit is contained in:
@@ -394,6 +394,12 @@ void CMakeBuildSystem::setParametersAndRequestParse(const BuildDirParameters &pa
|
||||
tr("The kit needs to define a CMake tool to parse this project.")));
|
||||
return;
|
||||
}
|
||||
if (!parameters.cmakeTool()->hasFileApi()) {
|
||||
TaskHub::addTask(BuildSystemTask(Task::Error,
|
||||
CMakeKitAspect::msgUnsupportedVersion(
|
||||
parameters.cmakeTool()->version().fullVersion)));
|
||||
return;
|
||||
}
|
||||
QTC_ASSERT(parameters.isValid(), return );
|
||||
|
||||
m_parameters = parameters;
|
||||
|
||||
@@ -255,10 +255,7 @@ Tasks CMakeKitAspect::validate(const Kit *k) const
|
||||
if (tool) {
|
||||
CMakeTool::Version version = tool->version();
|
||||
if (version.major < 3 || (version.major == 3 && version.minor < 14)) {
|
||||
result << BuildSystemTask(Task::Warning,
|
||||
tr("CMake version %1 is unsupported. Please update to "
|
||||
"version 3.14 (with file-api) or later.")
|
||||
.arg(QString::fromUtf8(version.fullVersion)));
|
||||
result << BuildSystemTask(Task::Warning, msgUnsupportedVersion(version.fullVersion));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -305,6 +302,13 @@ QSet<Utils::Id> CMakeKitAspect::availableFeatures(const Kit *k) const
|
||||
return {};
|
||||
}
|
||||
|
||||
QString CMakeKitAspect::msgUnsupportedVersion(const QByteArray &versionString)
|
||||
{
|
||||
return tr("CMake version %1 is unsupported. Please update to "
|
||||
"version 3.14 (with file-api) or later.")
|
||||
.arg(QString::fromUtf8(versionString));
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// CMakeGeneratorKitAspect:
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
@@ -56,6 +56,8 @@ public:
|
||||
void addToMacroExpander(ProjectExplorer::Kit *k, Utils::MacroExpander *expander) const final;
|
||||
|
||||
QSet<Utils::Id> availableFeatures(const ProjectExplorer::Kit *k) const final;
|
||||
|
||||
static QString msgUnsupportedVersion(const QByteArray &versionString);
|
||||
};
|
||||
|
||||
class CMAKE_EXPORT CMakeGeneratorKitAspect : public ProjectExplorer::KitAspect
|
||||
|
||||
@@ -204,7 +204,8 @@ public:
|
||||
if (column != 0)
|
||||
return QVariant();
|
||||
|
||||
const bool hasError = !m_pathExists || !m_pathIsFile || !m_pathIsExecutable;
|
||||
const bool hasError = !m_isSupported || !m_pathExists || !m_pathIsFile
|
||||
|| !m_pathIsExecutable;
|
||||
if (hasError)
|
||||
return Utils::Icons::CRITICAL.icon();
|
||||
return QVariant();
|
||||
|
||||
@@ -94,8 +94,6 @@ public:
|
||||
bool m_didAttemptToRun = false;
|
||||
bool m_didRun = true;
|
||||
|
||||
bool m_triedCapabilities = false;
|
||||
|
||||
QList<CMakeTool::Generator> m_generators;
|
||||
QMap<QString, QStringList> m_functionArgs;
|
||||
QVector<FileApi> m_fileApis;
|
||||
@@ -320,7 +318,7 @@ QVector<std::pair<QString, int>> CMakeTool::supportedFileApiObjects() const
|
||||
|
||||
CMakeTool::Version CMakeTool::version() const
|
||||
{
|
||||
return isValid() ? m_introspection->m_version : CMakeTool::Version();
|
||||
return m_introspection ? m_introspection->m_version : CMakeTool::Version();
|
||||
}
|
||||
|
||||
bool CMakeTool::isAutoDetected() const
|
||||
@@ -393,7 +391,6 @@ void CMakeTool::readInformation() const
|
||||
m_introspection->m_didAttemptToRun = true;
|
||||
|
||||
fetchFromCapabilities();
|
||||
m_introspection->m_triedCapabilities = true;
|
||||
}
|
||||
|
||||
static QStringList parseDefinition(const QString &definition)
|
||||
|
||||
Reference in New Issue
Block a user