Arm Mbed and Pelion Device Management support forum

Mbed compile without linking

Is there an option to call mbed compile for a single file only?
In projects with many sources the linking process takes a long time. So, compiling for syntax checking without linking would be nice.
Compiling could be started like ‘mbed compile --no-link’.

Hi,

Unfortunately not. If you modify only applicatoin files it should not compile everything like if do something to mbed_app.json. Linking should be relatively fast compared to compile everything.

Regards,
Pekka

thanks,
yes, ‘mbed compile’ will compile only the changed file(s), but with network and some stuff I’m around 200k binary size for the debug build and the gcc linker is not very fast (using Windows 10).
There is also a very large number of objecfiles that the linker need to handle. Using .mbedignore to reduce the amoung of files is a tedious task because of the increasing number of dependencies.
I’ve located build_project() in build_api.py already, there are the seperate calls to compile + link. Will try later to break execution here before linking.