How to stop PIO from auto-including every *.h file it founds in /src directory?

In example when I put
#include "math.h"
in main .cpp file I’ve got plenty of “redefined” errors in compiler as it was already auto-included without any notice.

I’d prefer to control what and when is included myself rather than watching for unfinished/unused files resided temporarily in /src directory.

Is there such an option in PIO for VScode?

You can’t.

As a workaround:

Thank you for prompt reply - links you provided show even more brilliant consequences of such imperative “customer service”(
Pity that it’s like this - one has to exclude files with build_src_filter instead of just doing what language standards offer - let dev to decide which needed ones to include…

Do you have any idea why PIO devs use such a strange approach for /src dir?

I’ve been playing with C++/Arduino/PIO for a year already. I’m gonna tell you something I didn’t notice at first.

The community is small. It is hobbyists, not professionals. You cannot expect much. If you have a problem, most likely you will have to come up with a solution yourself. Sad, but true.

So to answer your question: I don’t know why it is that way, but the LDF issue is at the core of PIO and nothing has changed in 4 years. I wound’t keep waiting… Replace LDF deep with native GCC Preprocessor · Issue #3113 · platformio/platformio-core · GitHub

Oh, I see the point. thank you.
But usually decision to share and support things outside of your own repo means than one started to care about other’s needs… Seems like PIO is unusual way of suffering.
Probably (4 years, heh) feet-voting is the only option left