forked from qt-creator/qt-creator
ProjectExplorer: Store parts of active build config in runcontrol
... on runcontrol creation to prevent later access. Adapt some users. There are more to come. Change-Id: I2a3fe5eea0ada4eff7d08b79a6f49694e6962c8a Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -35,7 +35,6 @@
|
|||||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
#include <debugger/debuggerrunconfigurationaspect.h>
|
||||||
#include <debugger/debuggerruncontrol.h>
|
#include <debugger/debuggerruncontrol.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -139,11 +138,11 @@ void AndroidDebugSupport::start()
|
|||||||
if (qtVersion)
|
if (qtVersion)
|
||||||
solibSearchPath.append(qtVersion->qtSoPaths());
|
solibSearchPath.append(qtVersion->qtSoPaths());
|
||||||
solibSearchPath.append(uniquePaths(extraLibs));
|
solibSearchPath.append(uniquePaths(extraLibs));
|
||||||
solibSearchPath.append(target->activeBuildConfiguration()->buildDirectory().toString());
|
solibSearchPath.append(runControl()->buildDirectory().toString());
|
||||||
solibSearchPath.removeDuplicates();
|
solibSearchPath.removeDuplicates();
|
||||||
setSolibSearchPath(solibSearchPath);
|
setSolibSearchPath(solibSearchPath);
|
||||||
qCDebug(androidDebugSupportLog) << "SoLibSearchPath: "<<solibSearchPath;
|
qCDebug(androidDebugSupportLog) << "SoLibSearchPath: "<<solibSearchPath;
|
||||||
setSymbolFile(target->activeBuildConfiguration()->buildDirectory().pathAppended("app_process"));
|
setSymbolFile(runControl()->buildDirectory().pathAppended("app_process"));
|
||||||
setSkipExecutableValidation(true);
|
setSkipExecutableValidation(true);
|
||||||
setUseExtendedRemote(true);
|
setUseExtendedRemote(true);
|
||||||
QString devicePreferredAbi = AndroidManager::devicePreferredAbi(target);
|
QString devicePreferredAbi = AndroidManager::devicePreferredAbi(target);
|
||||||
|
@@ -136,11 +136,7 @@ private:
|
|||||||
Target *target = runControl()->target();
|
Target *target = runControl()->target();
|
||||||
QTC_ASSERT(target, reportFailure(); return);
|
QTC_ASSERT(target, reportFailure(); return);
|
||||||
|
|
||||||
BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown;
|
if (runControl()->buildType() == BuildConfiguration::Release) {
|
||||||
if (const BuildConfiguration *buildConfig = target->activeBuildConfiguration())
|
|
||||||
buildType = buildConfig->buildType();
|
|
||||||
|
|
||||||
if (buildType == BuildConfiguration::Release) {
|
|
||||||
const QString wrongMode = ClangToolRunWorker::tr("Release");
|
const QString wrongMode = ClangToolRunWorker::tr("Release");
|
||||||
const QString toolName = tool()->name();
|
const QString toolName = tool()->name();
|
||||||
const QString title = ClangToolRunWorker::tr("Run %1 in %2 Mode?").arg(toolName, wrongMode);
|
const QString title = ClangToolRunWorker::tr("Run %1 in %2 Mode?").arg(toolName, wrongMode);
|
||||||
|
@@ -328,6 +328,9 @@ public:
|
|||||||
QMap<Core::Id, QVariantMap> settingsData;
|
QMap<Core::Id, QVariantMap> settingsData;
|
||||||
Core::Id runConfigId;
|
Core::Id runConfigId;
|
||||||
BuildTargetInfo buildTargetInfo;
|
BuildTargetInfo buildTargetInfo;
|
||||||
|
BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown;
|
||||||
|
FilePath buildDirectory;
|
||||||
|
Environment buildEnvironment;
|
||||||
Kit *kit = nullptr; // Not owned.
|
Kit *kit = nullptr; // Not owned.
|
||||||
QPointer<Target> target; // Not owned.
|
QPointer<Target> target; // Not owned.
|
||||||
QPointer<Project> project; // Not owned.
|
QPointer<Project> project; // Not owned.
|
||||||
@@ -376,6 +379,12 @@ void RunControl::setTarget(Target *target)
|
|||||||
if (!d->buildKey.isEmpty())
|
if (!d->buildKey.isEmpty())
|
||||||
d->buildTargetInfo = target->buildTarget(d->buildKey);
|
d->buildTargetInfo = target->buildTarget(d->buildKey);
|
||||||
|
|
||||||
|
if (auto bc = target->activeBuildConfiguration()) {
|
||||||
|
d->buildType = bc->buildType();
|
||||||
|
d->buildDirectory = bc->buildDirectory();
|
||||||
|
d->buildEnvironment = bc->environment();
|
||||||
|
}
|
||||||
|
|
||||||
delete d->outputFormatter;
|
delete d->outputFormatter;
|
||||||
d->outputFormatter = OutputFormatterFactory::createFormatter(target);
|
d->outputFormatter = OutputFormatterFactory::createFormatter(target);
|
||||||
if (!d->outputFormatter)
|
if (!d->outputFormatter)
|
||||||
@@ -907,6 +916,21 @@ QString RunControl::buildKey() const
|
|||||||
return d->buildKey;
|
return d->buildKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BuildConfiguration::BuildType RunControl::buildType() const
|
||||||
|
{
|
||||||
|
return d->buildType;
|
||||||
|
}
|
||||||
|
|
||||||
|
FilePath RunControl::buildDirectory() const
|
||||||
|
{
|
||||||
|
return d->buildDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
|
Environment RunControl::buildEnvironment() const
|
||||||
|
{
|
||||||
|
return d->buildEnvironment;
|
||||||
|
}
|
||||||
|
|
||||||
FilePath RunControl::targetFilePath() const
|
FilePath RunControl::targetFilePath() const
|
||||||
{
|
{
|
||||||
return d->buildTargetInfo.targetFilePath;
|
return d->buildTargetInfo.targetFilePath;
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "applicationlauncher.h"
|
#include "applicationlauncher.h"
|
||||||
|
#include "buildconfiguration.h"
|
||||||
#include "devicesupport/idevice.h"
|
#include "devicesupport/idevice.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "runconfiguration.h"
|
#include "runconfiguration.h"
|
||||||
@@ -228,6 +229,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString buildKey() const;
|
QString buildKey() const;
|
||||||
|
BuildConfiguration::BuildType buildType() const;
|
||||||
|
Utils::FilePath buildDirectory() const;
|
||||||
|
Utils::Environment buildEnvironment() const;
|
||||||
|
|
||||||
QVariantMap settingsData(Core::Id id) const;
|
QVariantMap settingsData(Core::Id id) const;
|
||||||
|
|
||||||
|
@@ -98,9 +98,6 @@ WinRtRunnerHelper::WinRtRunnerHelper(ProjectExplorer::RunWorker *runWorker, QStr
|
|||||||
m_loopbackArguments = QStringList{"--loopbackexempt", "client"};
|
m_loopbackArguments = QStringList{"--loopbackexempt", "client"};
|
||||||
else if (loopbackExemptServer)
|
else if (loopbackExemptServer)
|
||||||
m_loopbackArguments = QStringList{"--loopbackexempt", "server"};
|
m_loopbackArguments = QStringList{"--loopbackexempt", "server"};
|
||||||
|
|
||||||
if (BuildConfiguration *bc = runControl->target()->activeBuildConfiguration())
|
|
||||||
m_environment = bc->environment();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinRtRunnerHelper::appendMessage(const QString &message, Utils::OutputFormat format)
|
void WinRtRunnerHelper::appendMessage(const QString &message, Utils::OutputFormat format)
|
||||||
@@ -224,7 +221,7 @@ void WinRtRunnerHelper::startWinRtRunner(const RunConf &conf)
|
|||||||
|
|
||||||
process->setUseCtrlCStub(true);
|
process->setUseCtrlCStub(true);
|
||||||
process->setCommand(cmdLine);
|
process->setCommand(cmdLine);
|
||||||
process->setEnvironment(m_environment);
|
process->setEnvironment(m_worker->runControl()->buildEnvironment());
|
||||||
process->setWorkingDirectory(QFileInfo(m_executableFilePath).absolutePath());
|
process->setWorkingDirectory(QFileInfo(m_executableFilePath).absolutePath());
|
||||||
process->start();
|
process->start();
|
||||||
}
|
}
|
||||||
|
@@ -71,7 +71,6 @@ private:
|
|||||||
|
|
||||||
ProjectExplorer::RunWorker *m_worker = nullptr;
|
ProjectExplorer::RunWorker *m_worker = nullptr;
|
||||||
WinRtDevice::ConstPtr m_device;
|
WinRtDevice::ConstPtr m_device;
|
||||||
Utils::Environment m_environment;
|
|
||||||
QString m_runnerFilePath;
|
QString m_runnerFilePath;
|
||||||
QString m_executableFilePath;
|
QString m_executableFilePath;
|
||||||
QString m_debuggerExecutable;
|
QString m_debuggerExecutable;
|
||||||
|
Reference in New Issue
Block a user