bare-metal: Don't create C++ toolchain for auto-detected KEIL C51 compiler

... because this compiler support only the C language.

Change-Id: Id6da8da01eb8feff75acf29174fba4de10e0d3a0
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Denis Shienkov
2019-05-09 22:13:27 +03:00
parent a421ff2265
commit bb54d821d2

View File

@@ -512,7 +512,14 @@ QList<ToolChain *> KeilToolchainFactory::autoDetectToolchain(
const Macros macros = dumpPredefinedMacros(candidate.compilerPath, env.toStringList());
if (macros.isEmpty())
return {};
const Abi abi = guessAbi(macros);
const Abi::Architecture arch = abi.architecture();
if (arch == Abi::Architecture::Mcs51Architecture
&& language == ProjectExplorer::Constants::CXX_LANGUAGE_ID) {
// KEIL C51 compiler does not support C++ language.
return {};
}
const auto tc = new KeilToolchain(ToolChain::AutoDetection);
tc->setLanguage(language);