From 096147d96de2a3a8825602123c1107d14407942f Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 4 Nov 2019 18:06:41 +0100 Subject: [PATCH] McuSupport Vendor specific flash/run CMake targets The build system for QtMCU creates a CMake target "flash_%1_and_bootloader" for STM targets but not for NXP targets. Handle that (for now in a dirtry manner) in the run configuration. In master branch we can add the API needed for the runconfiguration to retrieve the list of available targets. Change-Id: If2c9089a5dc004900424041898a6ff426ebb450b Reviewed-by: Aurindam Jana --- src/plugins/mcusupport/mcusupportrunconfiguration.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp index c1c8a1f7a47..83acc2035bf 100644 --- a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp +++ b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp @@ -49,11 +49,17 @@ static CommandLine flashAndRunCommand(Target *target) const CMakeProjectManager::CMakeTool *tool = CMakeProjectManager::CMakeKitAspect::cmakeTool(target->kit()); + // TODO: Hack! Implement flash target name handling, properly + const QString targetName = + target->kit()->value(Constants::KIT_BOARD_VENDOR_KEY).toString() == "NXP" + ? QString("flash_%1").arg(projectName) + : QString("flash_%1_and_bootloader").arg(projectName); + return CommandLine(tool->filePath(), { "--build", ".", "--target", - QString("flash_%1_and_bootloader").arg(projectName) + targetName }); } @@ -63,7 +69,6 @@ FlashAndRunConfiguration::FlashAndRunConfiguration(Target *target, Core::Id id) auto effectiveFlashAndRunCall = addAspect(); effectiveFlashAndRunCall->setLabelText(tr("Effective flash and run call:")); effectiveFlashAndRunCall->setDisplayStyle(BaseStringAspect::TextEditDisplay); - effectiveFlashAndRunCall->setReadOnly(true); auto updateConfiguration = [target, effectiveFlashAndRunCall] { effectiveFlashAndRunCall->setValue(flashAndRunCommand(target).toUserOutput());