# 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
• Hello,

When adding or editing a build configuration there is an option called "Extra CMake Arguments" with the blue "Add argument" button.

To get the edit the build configuration tab you can either right click on it or click the three dots next to it.

And here I added "-DOPTION1" as an argument.

Best regards,

Michal

• Thanks!