Commit Graph

36 Commits

Author SHA1 Message Date
Karim Abdelrahman
b083a4d55e McuSupport: fix toolchain naming difference between windows and linux
Toolchain naming convention is different in windows "mingw" than in
linux "gcc". That caused the logic to fail on windows and prompt the
user to remove a kit of an existing target.

Task-number: QTCREATORBUG-29003
Change-Id: Ib99a9b38fec30b9a6826874f1acd0bb2f8615e1e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-05 06:31:07 +00:00
Christian Stenger
22952c5357 McuSupport: Fix missing include
Change-Id: Ie7a90edf3e4d6b289512a5bb60bca039b0b10fe3
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-03-28 04:53:13 +00:00
Karim Abdelrahman
06c4a46a6c McuSupport: Deregister kits for uninstalled target
Before the fix when the user uninstall a target, kits of the target will
remain visible on kits screen and can be selected when configuring a
project which is not a good user experience.

This change will use infobar to notify the user about the existence of
kits for uninstalled targets and ask the user if these kits should be
removed.

The change uses the fact that a kit description file have the
naming convention "toolchain-vendor-device" and compare it to the kits
exists in profile.xml. If a kit exists in profile.xml but its
description file doesn't (which mean the target has been uninstalled),
it will be removed from kits.

Task-number: QTCREATORBUG-28921
Change-Id: I9d4d1687429f26b6a42b77c5aa398f6bca5455d5
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-03-27 07:49:14 +00:00
Alessandro Portale
f99a340ea4 McuSupport: Tr::tr
Change-Id: Ia2f0e523a378bea82887bdb212acfdab47b408e9
Reviewed-by: hjk <hjk@qt.io>
2023-01-23 09:03:07 +00:00
hjk
66c08a824d Utils: Rename most FilePath::{from,to}Variant uses to {from,to}Settings
Specifies the main purpose more clearly. The remaining ones a "true"
(internal) variants in models and as action data.

Change-Id: I8dd3c846e419f29d88283c2f48268ef6685b19fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 09:00:30 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Kwangsub Kim
c39d89199e McuSupport: Avoid empty string for cmake toolchain vars
At the first run of Qt Creator after its installation, MSVC toolchain
command is set lazily after it's detected, so an empty string can be
set to cmake toolchain variable when a Qt for MCUs kit is created
automatically. It needs be avoided to keep the cmake variables valid.
Even when the command is not updated, it will work correctly with the
default variale (%{Compiler:Executable:(C,CXX)}).

Task-number: QTCREATORBUG-28457
Change-Id: I5de277831e7f1e696f67724193938d6eef7a12dd
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-11-16 14:27:35 +00:00
Kwangsub Kim
0be6ba955d McuSupport: Expand variables for automatic kits
An MCU kit that is created automatically also requires variable
expansion before the kit is generated. The same preparation for
the variables will be done as the MCU option page.

Task-number: UL-6603
Change-Id: I915f6f6e8c6e2a90409c527951e469c555002cff
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-09 13:00:00 +00:00
Kwangsub Kim
d881932695 McuSupport: Update library path for Windows platform
The Qt shared library for Windows desktop platform has been
moved from Qul 2.3.0 to support MinGW toolchain. The updated
library path needs to be configured correctly.

Task-number: QTCREATORBUG-28303
Change-Id: I7cf8150bfb4a66731904ea49089849496305f22e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-08 10:24:18 +00:00
Daniele Bortolotti
11c9332574 McuSupport: Use lower case platform name for CMake configurations
QUL_PLATFORM name is converted in CMake to lower case, resulting
in misleading warnings about platform name due to case mismatch.

Fixes: UL-6641
Change-Id: I25df689c91dca65ef67c80d9527c0afe7952278b
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-07 14:38:03 +00:00
Sivert Krøvel
6aaf33bee5 McuSupport: Do not update paths in kits for different SDK versions
When updating paths for a target in Devices > MCU, the paths were
updated in the corresponding kits for all Qt for MCUs versions.
This would break existing kits made for a different version than
the currently active one.

With this change, only kits made for the same SDK version as the
currently selected target will be modified.

Task-number: UL-6755
Change-Id: I6fda050094b5603914fbbc29a5fc2e83d974a2d6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-11-04 14:56:49 +00:00
Daniele Bortolotti
6f837e258a McuSupport: Inform only after actual kit creation
Previously, a message about successful kit creation was printed
for every kit without verification. So move the print to the
actual kit creation function. Issue also reported in
QTCREATORBUG-28281

Change-Id: I0e2cb463188210164a3582e7fa465a4ebb79b812
Reviewed-by: Sivert Krøvel <sivert.krovel@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-10-28 08:27:28 +00:00
Kwangsub Kim
d1a9cecf59 McuSupport: Fix crash when there is no proper desktop toolchain
Desktop toolchain is picked up from the registered toolchains
in Qt Creator, but it can be failed, for instance when there
is no toolchain for MinGW, and it causes crash for now. An
error handling is added to avoid it and inform to a user.

Task-number: QTCREATORBUG-28296
Change-Id: Ie16cd6c75df9be510bb49b765ad61ddf189a41db
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-10-26 08:45:43 +00:00
Kwangsub Kim
d7f9f45daf McuSupport: Identify MinGW toolchain
QtMCUs will support MinGW toolchain for Windows desktop platform,
so MinGW toolchain needs to be identified.

If the default toolchain or a user configured one is a correct
MinGW toolchain, it would be selected. If not, a proper toolchain
would be picked up from the registered toolchains in Qt Creator.

Task-number: UL-6607
Change-Id: I82580d721d9ed916a6b32d35c124a638d7a3e68e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-10-20 17:55:00 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Piotr Mućko
df92e79da4 McuSupport: Sync JSON files with QtMCUs repo and related fixes
This synchronizes JSON files used by unit tests with files
in QtMCUs repo. To do that some changes in code were needed.

QtMCUs package is no longer created for each JSON file. Because of
its nature it's created once and passed to each target.

Unit tests now have verifyPackage function to avoid duplication
of checks.

In test creating target QtMCUs package is checked beside toolchain
ones.

Change-Id: I5dea470daf184b45facfaaa793c359310ac22fc1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Yasser Grimes <yasser.grimes@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-09-23 07:48:14 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Yasser Grimes
d4efef7fc4 McuSupport: Add toolchain information for desktop kits
To be able to check the validity of a desktop toolchain used in an
mcusupport kit with qt platform.

Task-number: QTCREATORBUG-26750
Change-Id: Ifc518257844c8994150f3d86eb5512701c38c2b7
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-25 10:49:31 +00:00
Eike Ziller
f95a1eca34 Merge remote-tracking branch 'origin/8.0'
Change-Id: Icef5e28557701243e686d35cf885412eb341e75a
2022-06-28 11:35:16 +02:00
Eike Ziller
e46357a220 Adapt to move of options to Edit > Preferences
Change-Id: I6881f658db9eec5059b434bce12093667535d5ac
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-06-28 08:32:22 +00:00
Eike Ziller
c7b724c4ca Merge remote-tracking branch 'origin/8.0'
Change-Id: Ia1c97d5949de607177a5a0632c7e8a37cbfd3475
2022-06-27 10:33:44 +02:00
hjk
2496ffe3ce Code cosmetics
Mostly unused #include's, also sort them or reduce scope.

A few namespaces, ...

Change-Id: I9ee71e07de7157c9942125672addf87dd41e78f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-24 14:44:13 +00:00
Piotr Mućko
cf147aa4b6 McuSupport: Organize namespaces, separate legacy constants
qtc9 will use new implementation for qtForMCUs 2.3 and newer.
Legacy implementation will be used for older versions.

Change-Id: Ibb2919f25d03d6445b8328e20316d4f88203a463
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-06-24 08:32:14 +00:00
Christian Stenger
8479cb1514 McuSupport: Fix tests
Note, this also changes how the CMAKE_TOOLCHAIN_FILE is stored
inside the settings.

Change-Id: I018cc44be37deef36d685eb856bb706f47274017
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-11 10:23:01 +00:00
Piotr Mućko
6b28913161 McuSupport: Move auto kit creation settings to handler"
Change-Id: I86a8588b812c10e0d547405c432f9fdc9c72aee3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-05-09 08:16:12 +00:00
Piotr Mućko
3c3ea74ca2 McuSupport: Separate toolchain file and compiler packages
Toolchain package represents information about compiler and toolchain
file (.cmake). This information is parsed from JSON and used for Kit
creation. This includes cmake variables, path to compiler. This patch
extracts information about toolchain file into separate McuPackage.

Change-Id: Id165bdc5afa5d7cf5b5c96620e11cb878254c181
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-05-06 08:52:16 +00:00
Piotr Mućko
7cef593ec0 McuSupport: Extract settings handling to a class
Change-Id: I671098f14d7bc13255dc130a4de1ab97d5bdab94
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-28 10:29:20 +00:00
Piotr Mućko
1587896537 McuSupport: Use FilePath in version detector
Change-Id: I54d04881c0b759caeaa83156c606a539369f482b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christiaan Janssen <christiaan.janssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-04-27 10:38:58 +00:00
Piotr Mućko
080249e902 McuSupport: Generate kit name in setKitProperties
Change-Id: I88a0a2b1291322ad9313eb5d2ad8cafa28f3bfec
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-25 14:14:56 +00:00
Piotr Mućko
a3fbfac814 McuSupport: Automatic memory management for mcu sdk
Fix crash while automatically restoring kits during startup.
Change packages container to set to avoid duplicates.
Use RAII for McuSdkRepository.

Change-Id: I4b3f4156f0bc770c8a5ea8a171b1f22f6ffb8f96
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-01 13:55:34 +00:00
Christiaan Janssen
e293aab725 McuSupport: remove cmake mapper
Starting with Qt For MCUs 2.0, environment variables are not
used to track dependencies any more, but cmake variables are.
Due to time constraints, we implemented a env-to-cmake mapper
to cover that gap at the moment. This patch removes that hack
and implements tracking dependencies through cmake variables.

Task-number: QTCREATORBUG-26904
Change-Id: Id8553a764d212d9b12e4adc54fc56233bfeb9a5b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-11 14:24:34 +00:00
Christiaan Janssen
da6cf91432 McuSupport: Change Kit Aspects validation check CMake variables
Before QUL 2.0, path for tools used during compilation were passed as
environment variables. Starting with 2.0, they are passed as CMake
configuration arguments. So, in order to validate a kit, the
dependencies aspect now needs to validate the CMake configuration
aspects. As 1.9 will no longer be supported, starting with this version
of Qt Creator, the environment checking code is removed.

Change-Id: I24991063dcdf9b455bd8f20226756dc2b3637f6d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-03-02 11:37:53 +00:00
Christian Kandeler
52e26a360b Fix newly introduced warnings
Change-Id: I0b9cf3496d536e1173fbd6587e5b491305eb876c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-23 15:26:31 +00:00
Christiaan Janssen
7d9bb3f7e8 McuSupport: refactor McuPackage
rename 'type' to 'toolChainType' in McuToolChainPackage
'addToPath' and 'relativePath' set in McuPackage constructor
put McuToolChainPackage methods together in same source file
'detectionPath' type changed from QString to FilePath
renamed boolean getters

Task-number: QTCREATORBUG-26897
Change-Id: If59c299901a169d08efa8f39614ef7c6d48d44ed
Reviewed-by: Piotr Mućko <piotr.mucko@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-02-22 13:48:54 +00:00
Christiaan Janssen
e4da779653 McuSupport: move auto-kit-creation option to McuSupportOptions
It was part of McuPackage, and only used by the SDK instance.

Task-number: QTCREATORBUG-27093
Change-Id: I9d9eaac621e9997129c227fae3ac88b502ba4340
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-22 07:15:33 +00:00
Christiaan Janssen
2834e90930 McuSupport: split mcusupportoptions
Several independent classes were mashed together in mcusupportoptions.cpp
This patch moves McuToolChainPackage together with McuPackage,
McuTarget to its own header+source pair, and
McuKitManager to its own header+source pair.

Task-number: QTCREATORBUG-26890
Change-Id: I0b51da4e1cae5a976201dffd290a665eaa318b33
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-02-18 09:14:29 +00:00