diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 7ccb75abbed..542d0732fa3 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -307,6 +307,11 @@ CommandLine RunConfiguration::commandLine() const return m_commandLineGetter(); } +void RunConfiguration::setRunnableModifier(const RunnableModifier &runnableModifier) +{ + m_runnableModifier = runnableModifier; +} + void RunConfiguration::update() { if (m_updater) @@ -398,6 +403,8 @@ Runnable RunConfiguration::runnable() const r.workingDirectory = workingDirectoryAspect->workingDirectory(macroExpander()).toString(); if (auto environmentAspect = aspect()) r.environment = environmentAspect->environment(); + if (m_runnableModifier) + m_runnableModifier(r); return r; } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 5f3bb71a649..50652f30dd6 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -138,6 +138,9 @@ public: void setCommandLineGetter(const CommandLineGetter &cmdGetter); Utils::CommandLine commandLine() const; + using RunnableModifier = std::function; + void setRunnableModifier(const RunnableModifier &extraModifier); + virtual Runnable runnable() const; // Return a handle to the build system target that created this run configuration. @@ -194,6 +197,7 @@ private: QString m_buildKey; CommandLineGetter m_commandLineGetter; + RunnableModifier m_runnableModifier; Updater m_updater; Utils::MacroExpander m_expander; };