Skip to content

Conversation

sillydan1
Copy link

This PR adds a CMakePresets.json with the Release preset , which makes it much easier to get started on development, as code-editors such as VSCode, CLion and neovim support generating compile_commands.json databases using these presets. It does require a fairly recent cmake version though.

I only added one preset, Release for now and I didn't dare touch the CI stuff, but perhaps this could simplify the CI chain.

I also found that the requirements.txt file in tools/mcuboot didn't mention the adafruit-nrfutil dependency, so I added that to the build instructions.

Copy link

github-actions bot commented Jun 7, 2025

Build size and comparison to main:

Section Size Difference
text 379128B 0B
data 948B 0B
bss 22536B 0B

Run in InfiniEmu

@mark9064 mark9064 added the maintenance Background work label Jun 7, 2025
@sillydan1 sillydan1 force-pushed the editor-assistance branch from 456bffb to be8636c Compare June 7, 2025 10:31
Copy link
Member

@mark9064 mark9064 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice improvement overall :) Thanks for sending it in

I'm not sure about storing the toolchain inside the tree. Maybe environment variables like with the VSCode instructions would be more flexible? What are your thoughts, I do agree that having to configure env vars can be a bit annoying

CMakeUserPresets.json contains user (i.e. per developer) presets and
should therefore be ignored.

node_modules and so on is just for the lv_font_conv dependency.
This file helps editors to generate compile_commands.json database files
as well as streamlining some of the cmake commands.
@sillydan1 sillydan1 force-pushed the editor-assistance branch from be8636c to a7d43cf Compare June 28, 2025 10:04
@sillydan1
Copy link
Author

Looks like a nice improvement overall :) Thanks for sending it in

I'm not sure about storing the toolchain inside the tree. Maybe environment variables like with the VSCode instructions would be more flexible? What are your thoughts, I do agree that having to configure env vars can be a bit annoying

Thanks! 😁 Hmm... I see your point that using raw environment variables is very flexible, I just found it a bit annoying to use though - which is why I added the cmake presets file... These changes will technically not prevent users from manually setting the environment variables and calling cmake without the --preset option, but then that means we need to support multiple workflows. Sadly, there's no way to "use the environment variable if defined, otherwise, use the ${fileDir}/sdk-toolchain value(s)"... At least I haven't been able to figure it out without needing to compromise on flexibility...

To me, ideally, the buildsteps should just be:

  • Clone the project (with submodules)
  • cmake --preset Release
  • cmake --build build/Release

Where the CMakeLists.txt would download the SDK and toolchain for you at configure-time. I would love to try to get that done but it would require touching the CI and it would be a fairly big change to the now normal work flow, so I'm not sure if it would be too disruptive. Perhaps adding the presets just adds confusion and we should just close this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Background work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants