Page 1 of 1

How to force project to always link when building

Posted: Sat Dec 22, 2012 8:56 pm
by netrick
Hey.

In workspace I have few projects and one is called "Common". It cointains classes that other project share and it builds to static library. Other project include its headers and link it. Everything works, but it is very annoying that I change something in common project, compile it, then I compile another project and I get "nothing to be done". The solution is to rebuild the project, but it takes ages. I just want to re-link it, as only the lib has changed. Is there any way to do it? To do only "relink" instead of "rebuild"?

Thanks

Re: How to force project to always link when building

Posted: Sat Dec 22, 2012 9:10 pm
by eranif
netrick wrote:Hey.

In workspace I have few projects and one is called "Common". It cointains classes that other project share and it builds to static library. Other project include its headers and link it. Everything works, but it is very annoying that I change something in common project, compile it, then I compile another project and I get "nothing to be done". The solution is to rebuild the project, but it takes ages. I just want to re-link it, as only the lib has changed. Is there any way to do it? To do only "relink" instead of "rebuild"?

Thanks
You did not state your OS, so I will assume its Linux ( in the future, make sure you provide all info needed )

As a workaround, I suggest that you add a post build step to the "common" project which deletes the binaries that depends on it ( this will force a re-link )
You add a post build event from:

right click on the project, settings -> pre / post build commands -> Post build
and add something like:

Code: Select all

rm -f ../targetOne
Eran

Re: How to force project to always link when building

Posted: Sat Dec 22, 2012 9:20 pm
by netrick
Yes, I use linux. Thanks for quick reply!