Triggering re-build when header changes

General questions regarding the usage of CodeLite
Verax
CodeLite Enthusiast
Posts: 46
Joined: Sat Jan 19, 2013 10:31 am
Genuine User: Yes
IDE Question: C++
Contact:

Triggering re-build when header changes

Post by Verax »

Currently, if I only modify a header file, CodeLite doesn't recompile the source files that have included that header, as only the source files seem to be tracked. Is CodeLite able to figure out which source files have included the modified header and trigger a build of those source files?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Triggering re-build when header changes

Post by eranif »

Yes it does. However, it uses gcc to determine which files needs to be recompiled (its done via the Makefile)

Which compiler do you use?

Eran
Make sure you have read the HOW TO POST thread
User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: Triggering re-build when header changes

Post by Jarod42 »

Note that dependencies may not be up to date in some situations, as mentioned in
dependencies (.o.d) are not updated correctly (patch)
and in ticket http://sourceforge.net/p/codelite/bugs/751/.
Verax
CodeLite Enthusiast
Posts: 46
Joined: Sat Jan 19, 2013 10:31 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Triggering re-build when header changes

Post by Verax »

I'm using Sourcery Codebench Lite (GCC 4.7.3 arm-none-eabi). Could you kindly describe the mechanism by which this process works so I can investigate? I'm using the -MD option in my compiler flags.
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Triggering re-build when header changes

Post by Gibbon1 »

I had that problem quite awhile ago. I've totally forgotten what the issue exactly was but I have a lingering suspicion that it has to do with using the correct version of make.
Verax
CodeLite Enthusiast
Posts: 46
Joined: Sat Jan 19, 2013 10:31 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Triggering re-build when header changes

Post by Verax »

I think I may be on to something. My project makefiles look like this:

Code: Select all

ObjectSuffix           :=.o
DependSuffix           :=
PreprocessSuffix       :=.i
Shouldn't the DependSuffix have a ".d"? How do I specify this in CodeLite's settings?
Verax
CodeLite Enthusiast
Posts: 46
Joined: Sat Jan 19, 2013 10:31 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Triggering re-build when header changes

Post by Verax »

Found it: Settings --> Build Settings... --> Compilers --> Compiler --> Advanced --> Depends extension

Setting that to ".o.d" and checking the "Use compiler -MT switch to generate source dependencies files (*.o.d)" fixed it for me.

What a relief. Having to rebuild after each minor change is major productivity killer.
Post Reply