How to force project to always link when building

General questions regarding the usage of CodeLite
netrick
CodeLite Enthusiast
Posts: 19
Joined: Fri Dec 07, 2012 8:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

How to force project to always link when building

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to force project to always link when building

Post 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
Make sure you have read the HOW TO POST thread
netrick
CodeLite Enthusiast
Posts: 19
Joined: Fri Dec 07, 2012 8:20 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to force project to always link when building

Post by netrick »

Yes, I use linux. Thanks for quick reply!
Post Reply