With qmake, how to use precompiled headers except for one file?
Solved
General and Desktop
-
Suppose we have a project with 100
.cpp
files. They are compiled with a precompiled header (for speedup reasons), except for one (let's call itspecial.cpp
) which is not in our hands and, for reasons beyond this discussion, cannot use the precompiled header.In my
.pro
file, how can I prevent qmake from compilingspecial.cpp
with the precompiled header?Needs to work with Qt 5.12.0, Visual Studio 2017 and g++ 7.3.
-
@dave2
i think it might be doable by enabling the precompiled headers by default for the whole project and add a custom compiler to qmake and assign the files which shouldn't be compiled with the precompiled header to it.
Use QMAKE_CXX and QMAKE_CXX_FLAGS variables -
@raven-worx Thanks!