user1025852
user1025852

Reputation: 2784

best practice to avoid rebuild in vs2010

I have a solution that one of its projects takes too long to compile and rarely changes. That means that if a developer "ReBuild" the whole solution it will take time (though nothing was changed in this specific project).

I was suggested maybe to add some "pre-build event command line" but how exactly will I check if there is need to compile (I do want it to compile of it was changed)? and - if I can fail it - is this good practice? (in terms of continous integration etc.)

feel free to suggest any other way that I can avoid rebuild if no need even if some developer did mean rebuild for the entire solution.

Upvotes: 0

Views: 225

Answers (1)

Luchian Grigore
Luchian Grigore

Reputation: 258618

VS will usually figure out what needs to be re-built and only compile the appropriate projects. There are some steps you can take though:

  • avoid changes to headers, these trigger re-builds of all translation units that include them
  • use pre-compiled headers
  • use forward declarations instead of includes in header files (where possible)
  • break a large solutions into modular projects that link dynamically with each other

Upvotes: 2

Related Questions