forked from qt-creator/qt-creator
ProjectExplorer: Use canonical paths for compiler toolchain match
On Linux (Ubuntu 20.04) Qt Creator would use /usr/bin/g++ as
compiler for C++. CMake would pick /usr/bin/c++ as C++ compiler.
Both of them are symlinks to /usr/bin/x86_64-linux-gnu-g++-9
ammends 4ae5516453
Change-Id: Id50cb47ed4e728541baed6a191435f2ad0137628
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QLoggingCategory>
|
||||
@@ -394,7 +395,9 @@ ProjectImporter::findOrCreateToolChains(const ToolChainDescription &tcd) const
|
||||
{
|
||||
ToolChainData result;
|
||||
result.tcs = ToolChainManager::toolChains([&tcd](const ToolChain *tc) {
|
||||
return tc->language() == tcd.language && tc->compilerCommand() == tcd.compilerPath;
|
||||
return tc->language() == tcd.language &&
|
||||
Utils::Environment::systemEnvironment().isSameExecutable(
|
||||
tc->compilerCommand().toString(), tcd.compilerPath.toString());
|
||||
});
|
||||
for (const ToolChain *tc : result.tcs) {
|
||||
const QByteArray tcId = tc->id();
|
||||
|
Reference in New Issue
Block a user