How to avoid to include not used static library

Hi… I am working with esp32 on the arduino framework… (platformio for sure).
When I make a brand new project (flash size of esp32 is 4mb in my case) i see that the flash usage is already at 15%


Is it possible to configure or decide with HAL form the arduinoframework that I want to compile ?

In order to save memory ?

Thanks a lot