I found this trying to speed up the build process. When I start from mbed-os-example-blinky or mbed-os-empty, no matter the target I select, I get a 4-minute compile, with a lot of stuff that I don’t even use.
All Lora drivers, AT command drivers, GSM modem drivers, lwip drivers… and so on.
I thought the problem was .mbedignore so I ignored a lot of stuff from the list, and now I get linker errors. I dug deeper and found that in the BUILD folder, in mbed_config.h there are about 260 defines that I have never set. I guess during the compile-time, these define cause the dependencies to get compiled. But I can’t remove those since mbed_config.h is a generated file.
But there is no way to turn them off? Let’s say for example I want just Mbed that has RTOS and can blink an led, no connectivity whatsoever, no drivers for any OSI layer of communication, no device drivers, no TCP/IP. How can I do that?
And also, as a general opinion - why is this backward? The best I can find to remove those dependencies is to add overrides to mbed_app.json, but I don’t want to write exclusion for everything that I don’t use.
A blinky project should have just whatever is required to - blink a LED on a given OS. And if you want to connect to the LoRA for example, you would build up and add something along “#define USE_LORA” in your config and start with that.