Closed ReinhardKeil closed 3 weeks ago
Open question: what about setups
usage as part of cproject ?
setups
are local in every cproject.yml
This means that compiler adaption just becomes harder as every project needs to be configured. A cdefault.yml
has the benefit that in can be easier replaced to support i.e. a change in compiler options.
Example: MDK-Middleware ships with csolution.yml files that contain several similar example projects. These projects can easily configured to a compiler with just one cproject.yml
file.
I agree cdefault is top most compared to cproject. Pro and cons. yes. At a time we have discussed to get cdefault even more top most than csolution (IDE / workspace level ) what was a bit weird considering source control according to me because project not being self contain then. If adding cdefault close to csolution why csolution is not the place to be ? Open question still ... not challenging at all just trying to clear my own understanding.
cdefault.yml
file has the benefit that multiple *.csolution.yml
files can share it. IMHO easier to maintain.cdefault:
node to the *.cdefault.yml
file.compiler:
setting is no longer part of cdefault.yml
but explicitly selected using the command line option --toolchain
In contrast to #1450 - item 1, my recommendation is to add the compiler:
selection to the *.csolution.yml
project. This would make the toolchain selection clear for the user (and avoids that the option --toolchain
must be specified.
Related to #1278 and #1276
Replaced by #1576
The Problem To Be Solved
Toolchain agnostic projects do not select any compiler in the csolution project files. Instead, they can be configured for multiple compilers. To achieve this, projects can rely on the cdefault.yml file and use the
cdefault:
option incsolution.yml
.The
cdefault.yml
that is part of the CMSIS-Toolbox is suitable for simple single core projects.For more complex projects the example should provide an own
cdefault.yml
that is stored in the same directory as thecsolution.yml
file. It should be assumed that a localcdefault.yml
is configured for the compilers that are supported by the example or template.Suggest A Solution
The CMSIS-Toolbox knows already the installed toolchains by using for example:
To achieve a sensible selection, the
cbuild setup
command could iterate:cdefault.yml
which are assumed as working tools for a csolution project.The result are the available toolchains on the local host computer that are suitable to compile the project. In case of multiple toolchains, this could be offered as selection to the user.
Example
Local
cdefault.yml
contains only sections forAC6
,GCC
, orIAR
(as the project has been only tested for these 3 compilers.The IDE can now offer the selection between AC6 and GCC.
In case that no
AC6
section would be present incdefault.yml
only GCC could be selected.Proposed Changes:
Extend
cbuild setup
command to deliver available toolchains for a project in thecbuild-idx.yml
file when no toolchain is selected. The node is [select-toolchains:](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/blob/main/docs/YML-CBuild-Format.md#select-toolchains].Refer to
cbuild setup
command for details.Possible Implications
compiler:
selection incdefault.yml
for toolchain agnostic projects.