ProcessParameters: Allow to set the ProcessMode

Change-Id: I45db21d8785cfaecd8d524b4acda32e352640282
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Dominik Holland
2024-01-23 17:39:14 +01:00
parent ead7afde3d
commit 3ce58e0465
2 changed files with 6 additions and 0 deletions

View File

@@ -190,6 +190,7 @@ bool AbstractProcessStep::setupProcess(Process &process)
// For example Clang uses PWD for paths in debug info, see QTCREATORBUG-23788 // For example Clang uses PWD for paths in debug info, see QTCREATORBUG-23788
Environment envWithPwd = d->m_param.environment(); Environment envWithPwd = d->m_param.environment();
envWithPwd.set("PWD", workingDir.path()); envWithPwd.set("PWD", workingDir.path());
process.setProcessMode(d->m_param.processMode());
process.setEnvironment(envWithPwd); process.setEnvironment(envWithPwd);
process.setCommand({d->m_param.effectiveCommand(), d->m_param.effectiveArguments(), process.setCommand({d->m_param.effectiveCommand(), d->m_param.effectiveArguments(),
CommandLine::Raw}); CommandLine::Raw});

View File

@@ -6,6 +6,7 @@
#include "projectexplorer_export.h" #include "projectexplorer_export.h"
#include <utils/processinterface.h> #include <utils/processinterface.h>
#include <utils/processenums.h>
namespace Utils { namespace Utils {
class MacroExpander; class MacroExpander;
@@ -31,6 +32,9 @@ public:
void setMacroExpander(Utils::MacroExpander *mx) { m_macroExpander = mx; } void setMacroExpander(Utils::MacroExpander *mx) { m_macroExpander = mx; }
Utils::MacroExpander *macroExpander() const { return m_macroExpander; } Utils::MacroExpander *macroExpander() const { return m_macroExpander; }
void setProcessMode(Utils::ProcessMode mode) { m_processMode = mode; }
Utils::ProcessMode processMode() const { return m_processMode; }
/// Get the fully expanded working directory: /// Get the fully expanded working directory:
Utils::FilePath effectiveWorkingDirectory() const; Utils::FilePath effectiveWorkingDirectory() const;
/// Get the fully expanded command name to run: /// Get the fully expanded command name to run:
@@ -54,6 +58,7 @@ private:
mutable Utils::FilePath m_effectiveCommand; mutable Utils::FilePath m_effectiveCommand;
mutable QString m_effectiveArguments; mutable QString m_effectiveArguments;
mutable bool m_commandMissing = false; mutable bool m_commandMissing = false;
mutable Utils::ProcessMode m_processMode = Utils::ProcessMode::Reader;
}; };
} // namespace ProjectExplorer } // namespace ProjectExplorer