From 70373fbf1ac4510bf862a2ae45b2d4c2f52bcfca Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 24 Oct 2019 11:24:30 +0200 Subject: [PATCH] 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 Reviewed-by: Thiago Macieira Reviewed-by: hjk --- .../creator-only/creator-projects-compilers.qdoc | 5 +++-- src/plugins/projectexplorer/gcctoolchain.cpp | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/src/projects/creator-only/creator-projects-compilers.qdoc b/doc/src/projects/creator-only/creator-projects-compilers.qdoc index a06a38d9378..30d39dbffa9 100644 --- a/doc/src/projects/creator-only/creator-projects-compilers.qdoc +++ b/doc/src/projects/creator-only/creator-projects-compilers.qdoc @@ -63,8 +63,9 @@ Windows applications on Windows. MinGW is distributed together with \QC and Qt installers for Windows. - \li Linux ICC (Intel C++ Compiler) is a group of C and C++ compilers - for Linux. + \li ICC (Intel C++ Compiler) is a group of C and C++ compilers. + 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 LLVM compiler for Windows, Linux, and \macos. diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index e7616473986..0f81d9a40a7 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -221,8 +221,12 @@ static GccToolChain::DetectedAbisResult guessGccAbi(const FilePath &path, const QStringList arguments = extraArgs; arguments << "-dumpmachine"; 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(guessGccAbi(machine, macros), machine); } @@ -1833,7 +1837,7 @@ QList MingwToolChainFactory::detectForImport(const ToolChainDescrip LinuxIccToolChain::LinuxIccToolChain() : GccToolChain(Constants::LINUXICC_TOOLCHAIN_TYPEID) { - setTypeDisplayName(LinuxIccToolChainFactory::tr("Linux ICC")); + setTypeDisplayName(LinuxIccToolChainFactory::tr("ICC")); } /** @@ -1874,7 +1878,7 @@ QStringList LinuxIccToolChain::suggestedMkspecList() const LinuxIccToolChainFactory::LinuxIccToolChainFactory() { - setDisplayName(tr("Linux ICC")); + setDisplayName(tr("ICC")); setSupportedToolChainType(Constants::LINUXICC_TOOLCHAIN_TYPEID); setSupportedLanguages({Constants::CXX_LANGUAGE_ID, Constants::C_LANGUAGE_ID}); setToolchainConstructor([] { return new LinuxIccToolChain; });