Is it possible to exclude this file from the build somehow?
I’m running a teensy4.1 with freertos and would like to overload operators new & delete, but Arduino implemented these without a weak attribute, so ld complains about multiple definitions if I just provide an overload.
Mhmm I’ve played around a bit with various src_filters in the platformio.ini and with Advanced scripting (a post-script with env.Append(SRC_FILTER=["-<new.cpp>"]) basically, but that didn’t help either… Still got built.
I came up with a hack though: Renaming the new.cpp file to new.txt just before the to-be-built files are analyzed in a pre: script to prevent if from being included, then renaming it back shortly afterwards.
That’s great, at least it’s something.
I actually tried deleting the object file from the build directory using a post script, but that didn’t work either. Possibly because I got the something wrong in the script.