Commit e05f2889 authored by Oliver Wolff's avatar Oliver Wolff

winrt: Add runnable to run configuration

When Creator checks whether the application that is being debugged
is a debug build, it gets its information from the runnable so we
have to provide one when winrt is used.

Change-Id: I2259783f82eef96b50ba5f804306e5225919d24b
Reviewed-by: default avatarhjk <hjk@qt.io>
Reviewed-by: David Schulz's avatarDavid Schulz <david.schulz@qt.io>
parent 78ef474c
......@@ -32,6 +32,8 @@
#include <projectexplorer/target.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/runconfigurationaspects.h>
#include <projectexplorer/runnables.h>
#include <qmakeprojectmanager/qmakeproject.h>
namespace WinRt {
......@@ -93,5 +95,44 @@ QString WinRtRunConfiguration::buildSystemTarget() const
->mapProFilePathToTarget(Utils::FileName::fromString(m_proFilePath));
}
ProjectExplorer::Runnable WinRtRunConfiguration::runnable() const
{
ProjectExplorer::StandardRunnable r;
r.executable = executable();
r.commandLineArguments = arguments();
return r;
}
QString WinRtRunConfiguration::executable() const
{
QmakeProjectManager::QmakeProject *project
= static_cast<QmakeProjectManager::QmakeProject *>(target()->project());
if (!project)
return QString();
QmakeProjectManager::QmakeProFile *rootProFile = project->rootProFile();
if (!rootProFile)
return QString();
const QmakeProjectManager::QmakeProFile *pro
= rootProFile->findProFile(Utils::FileName::fromString(m_proFilePath));
if (!pro)
return QString();
QmakeProjectManager::TargetInformation ti = pro->targetInformation();
if (!ti.valid)
return QString();
QString destDir = ti.destDir.toString();
if (destDir.isEmpty())
destDir = ti.buildDir.toString();
else if (QDir::isRelativePath(destDir))
destDir = QDir::cleanPath(ti.buildDir.toString() + '/' + destDir);
QString executable = QDir::cleanPath(destDir + '/' + ti.target);
executable = Utils::HostOsInfo::withExecutableSuffix(executable);
return executable;
}
} // namespace Internal
} // namespace WinRt
......@@ -48,6 +48,8 @@ public:
QString buildSystemTarget() const final;
ProjectExplorer::Runnable runnable() const override;
signals:
void argumentsChanged(QString);
void uninstallAfterStopChanged(bool);
......@@ -58,6 +60,8 @@ private:
QString m_proFilePath;
bool m_uninstallAfterStop = false;
QString executable() const;
};
} // namespace Internal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment