Commit Graph

26 Commits

Author SHA1 Message Date
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