forked from qt-creator/qt-creator
ProjectExplorer: Introduce a ProjectConfiguration::kit() function
For convenience, and use it in some places. Change-Id: I8f7cb502b37b2fbf4cf2d17cac9c6299558332dc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -228,8 +228,7 @@ bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
|
||||
}
|
||||
}();
|
||||
if (initialCMakeArguments().isEmpty()) {
|
||||
QStringList initialArgs = defaultInitialCMakeArguments(target()->kit(),
|
||||
buildTypeName)
|
||||
QStringList initialArgs = defaultInitialCMakeArguments(kit(), buildTypeName)
|
||||
+ Utils::transform(conf, [this](const CMakeConfigItem &i) {
|
||||
return i.toArgument(macroExpander());
|
||||
});
|
||||
|
||||
@@ -414,7 +414,7 @@ void CMakeBuildSettingsWidget::updateAdvancedCheckBox()
|
||||
|
||||
void CMakeBuildSettingsWidget::updateFromKit()
|
||||
{
|
||||
const ProjectExplorer::Kit *k = m_buildConfiguration->target()->kit();
|
||||
const ProjectExplorer::Kit *k = m_buildConfiguration->kit();
|
||||
const CMakeConfig config = CMakeConfigurationKitAspect::configuration(k);
|
||||
|
||||
QHash<QString, QString> configHash;
|
||||
|
||||
@@ -209,7 +209,7 @@ bool CMakeBuildStep::init()
|
||||
canInit = false;
|
||||
}
|
||||
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit());
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(kit());
|
||||
if (!tool || !tool->isValid()) {
|
||||
emit addTask(BuildSystemTask(Task::Error,
|
||||
tr("A CMake tool must be set up for building. "
|
||||
@@ -264,8 +264,7 @@ void CMakeBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter)
|
||||
formatter->addLineParser(progressParser);
|
||||
cmakeParser->setSourceDirectory(project()->projectDirectory().toString());
|
||||
formatter->addLineParsers({cmakeParser, new GnuMakeParser});
|
||||
const QList<Utils::OutputLineParser *> additionalParsers
|
||||
= target()->kit()->createOutputParsers();
|
||||
const QList<Utils::OutputLineParser *> additionalParsers = kit()->createOutputParsers();
|
||||
for (Utils::OutputLineParser * const p : additionalParsers)
|
||||
p->setRedirectionDetector(progressParser);
|
||||
formatter->addLineParsers(additionalParsers);
|
||||
@@ -371,7 +370,7 @@ void CMakeBuildStep::setToolArguments(const QString &list)
|
||||
|
||||
Utils::CommandLine CMakeBuildStep::cmakeCommand(RunConfiguration *rc) const
|
||||
{
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit());
|
||||
CMakeTool *tool = CMakeKitAspect::cmakeTool(kit());
|
||||
|
||||
Utils::CommandLine cmd(tool ? tool->cmakeExecutable() : Utils::FilePath(), {});
|
||||
cmd.addArgs({"--build", "."});
|
||||
|
||||
@@ -757,7 +757,7 @@ void CMakeBuildSystem::wireUpConnections()
|
||||
|
||||
connect(project(), &Project::projectFileIsDirty, this, [this]() {
|
||||
if (cmakeBuildConfiguration()->isActive() && !isParsing()) {
|
||||
const auto cmake = CMakeKitAspect::cmakeTool(cmakeBuildConfiguration()->target()->kit());
|
||||
const auto cmake = CMakeKitAspect::cmakeTool(cmakeBuildConfiguration()->kit());
|
||||
if (cmake && cmake->isAutoRun()) {
|
||||
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
|
||||
Reference in New Issue
Block a user