How to put settings in platformio.ini to be used by all env sections?

They called, Airconditioning will not be installed today because it’s raining.
But since I was home anyway, I have tried a ton of different syntax for the interpolation.

What finally seems to work for me is

[env]
  build_flags=  
    -D_IR_ENABLE_DEFAULT_=false
    -DSEND_NEC=true
;  "-DSEND_CHIMEI=true"
;  "-DDECODE_NEC=true"

with PURPLE

[env:PURPLE]
platform = espressif32
board = esp32-s3-t-qt-4R2                     ; is a Json file with board specifications?
framework = arduino
lib_deps = bblanchon/ArduinoJson@^6.1.0
lib_ldf_mode = chain+

build_flags=
  ${env.build_flags}
  -I include 
  -D BOARD_HAS_PSRAM
  -mfix-esp32-psram-cache-issue
  -D ARDUINO_USB_MODE=1         
  ;-D ARDUINO_USB_CDC_ON_BOOT=1     
  -D ARDUINO_RUNNING_CORE=1       
  -D ARDUINO_EVENT_RUNNING_CORE=1  
  -D PurpleBox=1

Gives:

So for some reason it only works if i don’t use single or double quotation marks

edit: your name came up on several questions about the topic :slight_smile:
Thanks for your support

1 Like

Single and double quotation marks are only necessary when defining string macros.

See section “Stringification” in build_flags — PlatformIO latest documentation