Comments (4)
It is possible to make cotire work in that scenario by setting the COTIRE_PREFIX_HEADER_INCLUDE_PATH
property on the target or on the containing directory before invoking cotire, i.e.:
set_target_properties(mytarget PROPERTIES
COTIRE_PREFIX_HEADER_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/easylogging++.h")
...
cotire(mytarget)
Cotire will then select the easylogging++.h
header for inclusion in the prefix header while other header files in CMAKE_SOURCE_DIR
will continue to be ignored.
from cotire.
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!
from cotire.
Try adding #pragma once
to the easylogging++.h
header file. This should prevent the compile from re-opening the header.
from cotire.
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.
from cotire.
Related Issues (20)
- cotire and GCC flag "-include header.h"
- Project status HOT 2
- Problem using Cotire with Xcode10 New Build System HOT 1
- Run cotire from a different directory
- cxx
- MSVC 2017 /Fp and /Yc and /Yu Flags Broken On 391bf6b7609e14f5976bd5247b68d63cbf8d4d12 HOT 4
- Is it possible to exclude precompiled headers from the clean target?
- Exclude unity source from visual studio scanning
- How to configure runtime/thirdparty headers alone HOT 1
- Evaluation file to be written multiple times with different content
- Target cannot be cotired HOT 3
- why is PCH generation restricted to clang-cl on windows?
- Problems were encountered - C1083: Cannot open include file HOT 2
- New pre-compiled headers support in CMake 3.16 HOT 2
- cotire slows down the compilation of the test code
- MSVC target to be cotired has warning level: /W4 created cotire target: /W1
- Same Target Had been compile Twice with different Compile flags, but the prebuild header file hadn't been recreated. HOT 2
- redefinition of class 'xxxx'
- [pkgconfig] cotire doesn't fully support cmake function FindPkgConfig HOT 1
- Project output directory. Android HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cotire.