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
  • Hi Geoff

    That sounds strange indeed. Just to make sure, your projects don't have this config (or any of its dependencies) enabled by chance, do they? CONFIG_BUILD_WITH_TFM, as TFM is indeed non-secure samples, but are not limited to just those.

    It could also be something with your Visual Studio Code or SDK setup. If so I'd recommend trying to uninstall the extensions, VS Code, and remove the SDK from the toolchain manager before reinstalling to see if that helps. Alternatively if you have another computer you can install a fresh SDK and VSCode instance and see if you have the same issue with your project(s) there.

    Best regards,

    Simon

Children
Related