From bb54d821d2575dc8026961407c6436c5fdf9fdef Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Thu, 9 May 2019 22:13:27 +0300 Subject: [PATCH] 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 --- src/plugins/baremetal/keiltoolchain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index 984fb3341ea..6b978e8f6d0 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -512,7 +512,14 @@ QList 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);