Can't understand PIO logic when building libraries

Thanks, I got the idea, I’ll give it a try…

However, as far as I understand, I will have to describe each included library. Will it compile if I “disable” it programmatically using a preprocessor.

The fact is that I manage the esp32 configuration using a single file (similar to sdkconfig.h, but my own). And periodically turn on or off certain options. For example, now the device sends data to one cloud, and tomorrow I want to disable it and enable another.