forked from qt-creator/qt-creator
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:
@@ -1564,10 +1564,10 @@ bool ClangToolChain::matchesCompilerCommand(const FilePath &command) const
|
|||||||
m_resolvedCompilerCommand = FilePath();
|
m_resolvedCompilerCommand = FilePath();
|
||||||
if (HostOsInfo::isMacHost()
|
if (HostOsInfo::isMacHost()
|
||||||
&& compilerCommand().parentDir() == FilePath::fromString("/usr/bin")) {
|
&& compilerCommand().parentDir() == FilePath::fromString("/usr/bin")) {
|
||||||
std::unique_ptr<QtcProcess> xcrun(new QtcProcess);
|
QtcProcess xcrun;
|
||||||
xcrun->setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}});
|
xcrun.setCommand({"/usr/bin/xcrun", {"-f", compilerCommand().fileName()}});
|
||||||
xcrun->runBlocking();
|
xcrun.runBlocking();
|
||||||
const FilePath output = FilePath::fromString(xcrun->cleanedStdOut().trimmed());
|
const FilePath output = FilePath::fromString(xcrun.cleanedStdOut().trimmed());
|
||||||
if (output.isExecutableFile() && output != compilerCommand())
|
if (output.isExecutableFile() && output != compilerCommand())
|
||||||
m_resolvedCompilerCommand = output;
|
m_resolvedCompilerCommand = output;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user