Apply build flag for a specific file only

Hi everybody,

I was wondering if there is a way to set a build flag that is applied to a specific source file. I am trying to replicate CMakeLists configuration to build a dependency correctly. For instance, I would like to do the following:


Setting build_flags to -Wno-stringop-truncation" in platformio.ini or library.json works, but it applies this flag to all source files.

Thanks in advance!


This is exactly an application of advanced scripting as documented in

1 Like