How to configure MS Visual Studio 2005 project dependencies for efficient compilation (C ++)?

How to set up dependencies of a MS Visual Studio 2005 project so that making changes to a higher-level project does not recompile all other projects on which it depends.

If I have 5 dll projects that are linked differently ... Under "Project" -> "Dependencies" I have defined the next project down, but only one level. When I make a small change in a higher project select "Build" -> "Build myLib", the lower project is recompiled as well ... If I list all dependencies then all dependent projects will be recompiled as well ... which isn't correct, not is not it?

If I remove the explicit dependency, the lower project is not recovered, even if it should be (as I would expect).

What if I have multiple levels of dependency (depends on B depends on C, etc.)?

0


a source to share


3 answers


What if I have multiple levels of dependency (depends on B depends on C, etc.)?



Select project A from the dropdown, add B as a dependency. Likewise, for B, select C as the dependency.

+1


a source


How to set up MS Visual Studio 2005 project dependencies so that changing a higher level project does not force recompilation of all other projects on which it depends.

I think you mean:

How do I set up MS Visual Studio 2005 project dependencies so that changing a higher-level project doesn't force recompiling all other projects that depend, possibly indirectly, on it?



I think you are using terms like "above" and "below" in the opposite sense than I would like - for a couple of projects I think of the "bottom" project as one that depends on another, Maybe your "mental diagram "is just upright in relation to mine, which is good; or it may be that you have misinterpreted what the Project Dependencies window is asking for, which is not the case. It asks for a list of projects that the named project directly depends on in the drop-down list, namely those projects that need to be updated (which may require restoration) before the named project can be created.

So: could you please clarify in what sense you intend to accept "higher" and "lower".

What is VC ++ supposed to do (and I'm sure it does), when you ask to build some project X, check if they are all directly or indirectly related to all projects that X depends on them, and build everything that There is not. When this building happens, each project is always built after any projects on which it depends, directly or indirectly. Note that projects may need to be rebuilt even if they themselves do not change - for example. if X depends on Y and Y depends on Z, then changing Z and the query X to be built entails the first construction of Z, then Y (which has not been changed), then X. If there are even "lower" ones ( in my sense) projects that depend on X, they will not be created when you ask X to build.

0


a source


I have project dependent dependencies set for level only:

  • Project A depends on library B
  • Project A depends on library C

However library B also uses library C, but I don't have such an installation as dependencies. This seems to be okay.

Are you changing header files? Of course - if you change headers, then any project that depends on that header must be rebuilt regardless of whether the project settings are set or not.

-1


a source







All Articles