-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use header in source dir for PCH #31
Comments
It is possible to make cotire work in that scenario by setting the
Cotire will then select the |
Thanks, that fixes it and properly includes the file. The results are somewhat disappointed, I once experienced the precompiled headers in MSVC on Windows which gave me an incredible speedup while this shaves of a couple of seconds of the total compile time, but that's not cotire's fault of course. At least I managed to establish for certain that the header is only included once. The main drawback of course is that even though the precompiled headers are included and processed first, when handling the source files, the same headers are still located in the filesystem and scanned but only skipped thanks to their include guards. But I guess that's nearly impossible to avoid except by adding the include guards around the respective #include statements in the source files already, in other words, manually preparing the sources for precompiled headers. Anyway, thanks for the module and the help on this issue, I'll be looking into a way to make more efficient use of it! |
Try adding |
Well, yes, that might help for this specific instance of course, but it's a non-standard practice so I'd rather avoid it. And while I'm at it I would like to reduce the compile time for all the system includes, too. I now managed to fix this by creating a new dependencies.h header file that contains all my system / library headers in one spot, with include guards, and include that file in all the other source code instead of the separate files. When the PCH is loaded, this file is skipped and therefore all the dependent files are never even touched. This shaved another 20 seconds compile time off. Still not as impressive as what MSVC showed me, but at least an improvement. |
For a project I'm working on I recently added a header-only logging system to my project directory (http://easylogging.org/). This significantly increased the compile-time as it's a rather large header (near 6000 lines) that is included in most source files in my project.
However, it seems that due to the standard settings, headers in the source directory are ignored. SInce I didn't install the header on my system, it's in the include directory, which I assume is part of the source directory. Is this correct?
Because I basically only see an increase in compile-time due to the building of the unity targets, but the actual building of the rest of the project seems to take just as long.
Is this even a valid use case scenarior for the use of cotire, or should I be looking at different ways to reduce my compile time? Thanks for your suggestions.
The text was updated successfully, but these errors were encountered: