forked from qt-creator/qt-creator
ProjectExplorer: Allow "c++" for MinGW imported compiler
Usually GCC on Linux is providing a symlink for "c++" as "g++". MinGW on Windows is providing a copy of the executable, which gets ignored by Qt Creator. CMake is preferring "c++" instead of "g++" and Qt Creator will ignore such a detected compiler at import time. Change-Id: I3e19e1f1c29cad50cdc92c17a15f246188411597 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1980,10 +1980,15 @@ Toolchains MingwToolChainFactory::autoDetect(const ToolchainDetector &detector)
|
||||
Toolchains MingwToolChainFactory::detectForImport(const ToolChainDescription &tcd) const
|
||||
{
|
||||
const QString fileName = tcd.compilerPath.completeBaseName();
|
||||
if ((tcd.language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc")
|
||||
|| fileName.endsWith("gcc")))
|
||||
|| (tcd.language == Constants::CXX_LANGUAGE_ID && (fileName.startsWith("g++")
|
||||
|| fileName.endsWith("g++")))) {
|
||||
|
||||
const bool cCompiler = tcd.language == Constants::C_LANGUAGE_ID
|
||||
&& (fileName.startsWith("gcc") || fileName.endsWith("gcc"));
|
||||
|
||||
const bool cxxCompiler = tcd.language == Constants::CXX_LANGUAGE_ID
|
||||
&& ((fileName.startsWith("g++") || fileName.endsWith("g++"))
|
||||
|| (fileName.startsWith("c++") || fileName.endsWith("c++")));
|
||||
|
||||
if (cCompiler || cxxCompiler) {
|
||||
return autoDetectToolChain(tcd, [](const ToolChain *tc) {
|
||||
return tc->targetAbi().osFlavor() == Abi::WindowsMSysFlavor;
|
||||
});
|
||||
|
Reference in New Issue
Block a user