Defining preprocessor options using Visual Studio Code

I'm transitioning from SES to Visual Studio Code.

In SES, I can define multiple builds and then define preprocessor options (eg. -DOPTION1) for each build definition

I don't see a way to do this when using the nRF Connect SDK and Visual Studio Code.

(Note:  I know how to specify defines using the CMakeLists.txt file for all builds (using add_definitions(-DOPTION1) , but not on a "per-build" basis).

I'm using the NRF CONNECT extension in Visual Studio Code.

Thanks!

Parents Reply
  • Thanks Simon.  Not a sysbuild and also not a board with _ns base - thats TFM isnt it?  It is a nRF5340 project and it does use a custom board but it is based on your nrf5340dk_nrf5340_cpuapp with just devicetree changes. 

    HOWEVER, I just loaded an old project (one of your examples) from many months ago that was last built using a different version of the extensions and SDK and I CAN see the Save Configuration option!  But the extension was asking to pristine build as it is stale and after that the option is gone, no other changes.  Is it possible my IDE/projects have some kind of stale setting in it? My setup has been through several SDK and extenstion updates by this point (currently on SDK 2.4.1).

    To confirm I just made a brand new project+build (non _ns and non sysbuild) using one of your examples against nrf5340dk_nrf5340_cpuapp and no Save Configuratiton option, so don't think it is as simple as not working with sysbuild and TFM.

Children
Related