Toolchains: Better out-of-the-box support for the Intel C++ compiler

- Make sure it gets auto-detected on macOS, where the -dumpmachine
  option, while present and documented, doesn't print anything.
- Do not call it "Linux ICC", as it's also available on macOS.
  There is no danger of confusion with the MSVC-based variant,
  as the respective UI elements are not present on Windows.

Fixes: QTCREATORBUG-18304
Change-Id: Ibe70c618cf28ecfb105efefc3fe2b79814a0f0ce
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-10-24 11:24:30 +02:00
parent 5fcfe159cf
commit 70373fbf1a
2 changed files with 10 additions and 5 deletions

View File

@@ -63,8 +63,9 @@
Windows applications on Windows. MinGW is Windows applications on Windows. MinGW is
distributed together with \QC and Qt installers for Windows. distributed together with \QC and Qt installers for Windows.
\li Linux ICC (Intel C++ Compiler) is a group of C and C++ compilers \li ICC (Intel C++ Compiler) is a group of C and C++ compilers.
for Linux. Only the GCC-compatible variant, available for Linux and \macos,
is currently supported by \QC.
\li Clang is a C, C++, Objective C, and Objective C++ front-end for the \li Clang is a C, C++, Objective C, and Objective C++ front-end for the
LLVM compiler for Windows, Linux, and \macos. LLVM compiler for Windows, Linux, and \macos.

View File

@@ -221,8 +221,12 @@ static GccToolChain::DetectedAbisResult guessGccAbi(const FilePath &path, const
QStringList arguments = extraArgs; QStringList arguments = extraArgs;
arguments << "-dumpmachine"; arguments << "-dumpmachine";
QString machine = QString::fromLocal8Bit(runGcc(path, arguments, env)).trimmed(); QString machine = QString::fromLocal8Bit(runGcc(path, arguments, env)).trimmed();
if (machine.isEmpty()) if (machine.isEmpty()) {
// ICC does not implement the -dumpmachine option on macOS.
if (HostOsInfo::isMacHost() && (path.fileName() == "icc" || path.fileName() == "icpc"))
return GccToolChain::DetectedAbisResult({Abi::hostAbi()});
return GccToolChain::DetectedAbisResult(); // no need to continue if running failed once... return GccToolChain::DetectedAbisResult(); // no need to continue if running failed once...
}
return GccToolChain::DetectedAbisResult(guessGccAbi(machine, macros), machine); return GccToolChain::DetectedAbisResult(guessGccAbi(machine, macros), machine);
} }
@@ -1833,7 +1837,7 @@ QList<ToolChain *> MingwToolChainFactory::detectForImport(const ToolChainDescrip
LinuxIccToolChain::LinuxIccToolChain() : LinuxIccToolChain::LinuxIccToolChain() :
GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID) GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID)
{ {
setTypeDisplayName(LinuxIccToolChainFactory::tr("Linux ICC")); setTypeDisplayName(LinuxIccToolChainFactory::tr("ICC"));
} }
/** /**
@@ -1874,7 +1878,7 @@ QStringList LinuxIccToolChain::suggestedMkspecList() const
LinuxIccToolChainFactory::LinuxIccToolChainFactory() LinuxIccToolChainFactory::LinuxIccToolChainFactory()
{ {
setDisplayName(tr("Linux ICC")); setDisplayName(tr("ICC"));
setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID); setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID);
setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID});
setToolchainConstructor([] { return new LinuxIccToolChain; }); setToolchainConstructor([] { return new LinuxIccToolChain; });