Mbed build vs clean build

Can anyone please give an explanation of how build vs clean build in mbed works. I have an active program in mbed studio and it includes some libraries and some user defined header and cpp files. I make regular changes in the user defined .cpp files. Would build make note of the changes in files other than main.cpp or do i need to do clean build. Clean build takes a long time in my computer and would like to know what are my options to speed it up? Thanks.


for speed up you can try this

My basic understanding…

  • When you first time press build then all .cpp files are precompiled and that take long time.
  • When you you press it second time then it will be compiled only changed files, if the changes are not huge like a configuration and so on. That compilation is much faster because most of content is precompiled from first compilation.
  • The Clean Build will “delete” all precompiled sources and it is re- builded again from start like with first compilation, and of course it take long time. Anyway it is useful. Sometimes happens, it occurs to some error during changing a configuration or something similar. And then you need to use clean build.

BR, Jan

1 Like

Thanks Jan for your detailed answer. I am able to get the idea now. Thanks for the link as well. One of the problems that i was facing was when i build it, it wasn’t compiling all the modified cpp files. The changes i made in files other than main.cpp was not being compiled and only when I do clean build, all .cpp files are getting it compiled. Any ideas on why that would happen?

I don’t know if that behavior is normal or not.
Maybe try to make it as new topic under Mbed Studio section.

BR, Jan

Sure. I will do that. Thanks.