summaryrefslogtreecommitdiffstats
path: root/qmake/doc/src
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2018-01-02 19:07:03 +0200
committerOrgad Shaneh <orgads@gmail.com>2018-01-08 15:02:21 +0000
commitaf1a179cc8b599523ca858b1b9f55c93a734d047 (patch)
tree4639ebfd7ec5e43d76beff704fa18a18d1ff428f /qmake/doc/src
parent3e58f2b090661aab7302132cb2da661c8e227bc2 (diff)
qmake: Introduce precompile_header_c for MSVC
MSVC requires that the C PCH file is compiled (as an object) and linked if any C file is found, and the same for C++. Most qmake projects are C++. If a C++ project has a precompiled header, it is typically of C++ type, and cannot be compiled as C (for example, it contains or includes classes). Since there is no easy way to conditionally build the C PCH file only if C files are found in the project (as done for g++), we need a setting that is disabled by default. This amends 30331afda118. [ChangeLog][Tools][qmake] Introduced precompile_header_c CONFIG option for MSVC to enable precompiled header for C sources. Task-number: QTBUG-65103 Change-Id: Id9688a35ee7d9b5e4f5a846b81986cb674bc5f4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'qmake/doc/src')
-rw-r--r--qmake/doc/src/qmake-manual.qdoc7
1 files changed, 7 insertions, 0 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 58c51502b0..16b498d36e 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -939,6 +939,8 @@
order in which they are given.
\row \li precompile_header \li Enables support for the use of
\l{Using Precompiled Headers}{precompiled headers} in projects.
+ \row \li precompile_header_c (MSVC only) \li Enables support for the use of
+ \l{Using Precompiled Headers}{precompiled headers} for C files.
\row \li warn_on \li The compiler should output as many warnings as possible.
If \c warn_off is also specified, the last one takes effect.
\row \li warn_off \li The compiler should output as few warnings as possible.
@@ -4623,6 +4625,11 @@
\snippet code/doc_src_qmake-manual.pro 106
+ To use the precompiled header also for C files on MSVC nmake target, add
+ \c precompile_header_c to the \l{CONFIG} variable. If the header is
+ used also for C++ and it contains C++ keywords/includes, enclose them
+ with \c{#ifdef __cplusplus}).
+
\section1 Notes on Possible Issues
On some platforms, the file name suffix for precompiled header files is