nRF Connect SDK - Visual Studio Code build suggestions

When using Segger Embedded Studio, multiple build targets can be defined.    Each build definition can have its own "defines", libraries, etc.

When using Visual Studio Code (VSC) multiple build configurations can also be defined.  It looks like Cmake arguments can be assigned in the configuration definition, but these arguments don't seem to be passed on to the actual C compilation.   Rather, it looks like the only way to add defines/flags is via the "add_definitions" clause in the CMakeLists.txt file.     So does there need to be separate CMakeLists.txt files for each build target?

Being relatively new to VSC, I'm looking for the recommended way to handle differences between debug and release builds.     It seems pretty obvious that multiple build configurations can be defined, but should each reference a different prj.conf file?     Would the separate prj.conf files be the appropriate place to enable/disable Logging (enable for debug, disable for release), etc?  Or is there a different way to accomplish this?

Looking for general recommendations for defining multiple build definitions...   There seems to be a lot to configure - and multiple places to do the configuration (.dts (and now .dtsi), prj.conf, CMakeLists.txt, etc.)       I found some documentation, but nothing seems to address (in general) what is configured where...  and what is recommended for handling moving between debug/release configurations easily...       Have I missed the documentation?

Thanks!

Parents
  • Hello,

    To do this you could for example create a release.conf and debug.conf file, where you add the specific configurations for the debug/release build case, and then add each of them to the different build configurations as shown in the picture:

    To illustrate, you can create a debug.conf file or a conf directory with all your .conf files, and then add each of these to your different build configurations as needed.

    Best regards,
    Karl

Reply
  • Hello,

    To do this you could for example create a release.conf and debug.conf file, where you add the specific configurations for the debug/release build case, and then add each of them to the different build configurations as shown in the picture:

    To illustrate, you can create a debug.conf file or a conf directory with all your .conf files, and then add each of these to your different build configurations as needed.

    Best regards,
    Karl

Children
No Data
Related