views:

236

answers:

4

I have a solution with Many dlls and two exe's. The exes are Dependant on the dlls when I make an internal change to any of the dlls one of my exes rebuilds and generates all its code every time. My assumption would be that it would only need to relink if no source file it depended on had changed. Could there be a setting I am missing causing it to do a full rebuild every time.

A: 

Have you verified that there are no cyclic references/dependencies between your dll and your exe?

Greg D
+1  A: 

I am pretty sure that Studio (more specifically MSBuild) does not track dependancies at the source file level, so when you are changing the source to the dll, all visual studio sees is that a dll that it depends on has changed, so it rebuilds the exe.

David
A: 

This usually happens if the exe is dependent on a .h file from your dll project (includes the .h). If you change the .h it will make the exe rebuild. If you change the .cpp, the exe shouldn't rebuild. At least that's how it works for me. Generally DevStuido is smart enough to figure out what needs to be rebuilt and only builds what needs to be done.

miked
I'm changing the cpp
rerun
Can you find out if the exe depends on that .cpp somewhere. I.e., through a series of includes (bad form, but possible), through a series of static libraries that you're not thinking of?If you're not changing the function signatures, the exe shouldn't need to be rebuilt.Is is rebuilding the whole exe, or is it is just relinking?
miked
its rebuilding the whole exe this is a 4300 file project so I think I'm going to have to look a the preprocessor out put and see whats causing it. ARG
rerun
A: 

@David MSbuild does certainly do deep checking of timestamps. It knows what headers your compilation used all they way back to windows.h or whatever. If you dial up verbosity to detailed you will see what file triggered the build, and if it's a header it will be shown there.

Dan/msbuild

dan