GccToolChain: Create process on stack

Amends 948f0070fa

Change-Id: I67c537f19da6cd012d1d51d80f0b987dd2b1fede
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-11-23 18:38:23 +01:00
parent 706b0ff9eb
commit 5e5d412fc4

View File

@@ -1564,10 +1564,10 @@ bool ClangToolChain::matchesCompilerCommand(const FilePath &command) const
m_resolvedCompilerCommand = FilePath();
if (HostOsInfo::isMacHost()
&& compilerCommand().parentDir() == FilePath::fromString("/usr/bin")) {
std::unique_ptr<QtcProcess> xcrun(new QtcProcess);
xcrun->setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}});
xcrun->runBlocking();
const FilePath output = FilePath::fromString(xcrun->cleanedStdOut().trimmed());
QtcProcess xcrun;
xcrun.setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}});
xcrun.runBlocking();
const FilePath output = FilePath::fromString(xcrun.cleanedStdOut().trimmed());
if (output.isExecutableFile() && output != compilerCommand())
m_resolvedCompilerCommand = output;
}