Project Management, long compile-times
-
heyhey, I have several projects that are dependent of each other with a lot of source and header files. Like project: A<-B<-C<-D (B dependent of A, ...) The projects themselves are each quite large and except one they all build static libraries (of course?). In each project I have a file called like ProjectCPrivate.h that I include from each header file from within project C. in this header actually only project B is referenced (and indirectly A) and some settings (defines) for the project itself. Also for each project I have a file like ProjectC which includes pretty much every class from project C, so that I can easily use this header file for project D and so on... I'm facing long compile-times as the project grows. I'm not 100% sure if all this is solved by precompiled headers if used correctly. maybe my projects-design is lacking efficiency from the beginning. Using a precompiled header for each project would pretty much map the precompiled-header file to ProjectXPrivate.h, right? What do you guys think? Thanks a lot in advance zqueezy
-
heyhey, I have several projects that are dependent of each other with a lot of source and header files. Like project: A<-B<-C<-D (B dependent of A, ...) The projects themselves are each quite large and except one they all build static libraries (of course?). In each project I have a file called like ProjectCPrivate.h that I include from each header file from within project C. in this header actually only project B is referenced (and indirectly A) and some settings (defines) for the project itself. Also for each project I have a file like ProjectC which includes pretty much every class from project C, so that I can easily use this header file for project D and so on... I'm facing long compile-times as the project grows. I'm not 100% sure if all this is solved by precompiled headers if used correctly. maybe my projects-design is lacking efficiency from the beginning. Using a precompiled header for each project would pretty much map the precompiled-header file to ProjectXPrivate.h, right? What do you guys think? Thanks a lot in advance zqueezy
You could try to use the /MP compiler switch for multiple copies of the compiler (cl.exe). But this will not work with pre-compiled headers. So you will have to disable pre-compiled headers. Build with Multiple Processes[^]
«_Superman_» I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) -
heyhey, I have several projects that are dependent of each other with a lot of source and header files. Like project: A<-B<-C<-D (B dependent of A, ...) The projects themselves are each quite large and except one they all build static libraries (of course?). In each project I have a file called like ProjectCPrivate.h that I include from each header file from within project C. in this header actually only project B is referenced (and indirectly A) and some settings (defines) for the project itself. Also for each project I have a file like ProjectC which includes pretty much every class from project C, so that I can easily use this header file for project D and so on... I'm facing long compile-times as the project grows. I'm not 100% sure if all this is solved by precompiled headers if used correctly. maybe my projects-design is lacking efficiency from the beginning. Using a precompiled header for each project would pretty much map the precompiled-header file to ProjectXPrivate.h, right? What do you guys think? Thanks a lot in advance zqueezy
zqueezy wrote:
Using a precompiled header for each project would pretty much map the precompiled-header file to ProjectXPrivate.h, right?
you could also put all the standard C/C++ .H files in there (STL, stdio, windows.h, etc.). i just did that last night for a 12-project solution - all the non-project includes went into the PCH, along with anything that would cause a full (or near full) rebuild anyway. seems to have sped-up the build a bit. it wasn't a huge difference, however.
-
heyhey, I have several projects that are dependent of each other with a lot of source and header files. Like project: A<-B<-C<-D (B dependent of A, ...) The projects themselves are each quite large and except one they all build static libraries (of course?). In each project I have a file called like ProjectCPrivate.h that I include from each header file from within project C. in this header actually only project B is referenced (and indirectly A) and some settings (defines) for the project itself. Also for each project I have a file like ProjectC which includes pretty much every class from project C, so that I can easily use this header file for project D and so on... I'm facing long compile-times as the project grows. I'm not 100% sure if all this is solved by precompiled headers if used correctly. maybe my projects-design is lacking efficiency from the beginning. Using a precompiled header for each project would pretty much map the precompiled-header file to ProjectXPrivate.h, right? What do you guys think? Thanks a lot in advance zqueezy
zqueezy wrote:
I have a file called like ProjectCPrivate.h that I include from each header file from within project C
Sounds like you're coupling the external interface of each 'Project C' to the internal interface - that's probably something to minimise, otherwise changes to that internal interface will require rebuilding of the whole system that's upstream of it. That should help when doing incremental builds. As for full builds...well, I've never found that the number of include files is much of a problem - it's the total amount of source code needing to be built...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p CodeProject MVP for 2010 - who'd'a thunk it!