The ESP32 component search is including a non used component on my code

Hi, the PlatformIO is recognizing that my code need bluetooth module because in my code i have this:

#ifdef ENABLE_BLE_BEACON
#include "BLEDevice.h"
#include "BLEServer.h"
#include "BLEBeacon.h"
#endif

The problem here is that these includes are guard by a definition, but platformio doesnt respect that this definition is not defined. Then to low my firmware size i need to comment or delete this code.

https://docs.platformio.org/en/latest/projectconf/sections/env/options/library/lib_ldf_mode.html

1 Like

Maybe this behavior must be the default one right (the + one)?

It’s more computationally expensive so I think that’s why it’s not the default.