cmWorkerPool: Adopt MaybePrependCmdExe calls to reduce duplication

This commit is contained in:
Brad King 2025-01-31 11:49:21 -05:00
parent cf7ba6d43d
commit 104ca10208
2 changed files with 2 additions and 5 deletions

View File

@ -888,8 +888,6 @@ void cmQtAutoMocUicT::JobMocPredefsT::Process()
// Check if response file is necessary
MaybeWriteResponseFile(this->MocConst().PredefsFileAbs, cmd);
cmSystemTools::MaybePrependCmdExe(cmd);
// Execute command
if (!this->RunProcess(GenT::MOC, result, cmd, reason.get())) {
this->LogCommandError(GenT::MOC,
@ -2091,7 +2089,6 @@ void cmQtAutoMocUicT::JobCompileMocT::Process()
cmd.push_back(sourceFile);
MaybeWriteResponseFile(outputFile, cmd);
cmSystemTools::MaybePrependCmdExe(cmd);
}
// Execute moc command
@ -2158,8 +2155,6 @@ void cmQtAutoMocUicT::JobCompileUicT::Process()
cmd.emplace_back(outputFile);
cmd.emplace_back(sourceFile);
cmSystemTools::MaybePrependCmdExe(cmd);
cmWorkerPool::ProcessResultT result;
if (this->RunProcess(GenT::UIC, result, cmd, this->Reason.get())) {
// Uic command success

View File

@ -17,6 +17,7 @@
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmUVHandlePtr.h"
/**
@ -191,6 +192,7 @@ void cmUVReadOnlyProcess::setup(cmWorkerPool::ProcessResultT* result,
std::vector<std::string> command,
std::string const& workingDirectory)
{
cmSystemTools::MaybePrependCmdExe(command);
this->Setup_.WorkingDirectory = workingDirectory;
this->Setup_.Command = std::move(command);
this->Setup_.Result = result;