summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-02-08 15:56:39 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2021-02-10 21:56:27 +0000
commit9d49f19291a2cf505eef1d1478b5984c4a479c15 (patch)
treed203a28924df707bdc0da92a081b5ddf96c79f85
parent128370356fdcd7fa125566cbc83a0527f2764511 (diff)
Fix compilation of the QPSQLDriverPlugin plugin with enabled PCH
PostgreSQL package delivers several header files such as pthread, zlib, zconf, uuid, etc. within Windows installation package. The headers are exposed to the compiler by PostgreSQL include paths and have different versions. When compiling PCH of the QPSQLDriverPlugin plugin, MinGW uses the pthread.h header from the PostgreSQL include paths, that cause an error related to pthread implementation mismatch. Disable PCH for the QPSQLDriverPlugin plugin, when using MinGW. Fixes: QTBUG-90850 Change-Id: I0be91bbefe37731acb2658d679b5b644ef552b23 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 43cb801ccb10e2d9efd230803822761b794fd4fb)
-rw-r--r--src/plugins/sqldrivers/psql/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/sqldrivers/psql/CMakeLists.txt b/src/plugins/sqldrivers/psql/CMakeLists.txt
index 2de82be2f8..ab3d6c03aa 100644
--- a/src/plugins/sqldrivers/psql/CMakeLists.txt
+++ b/src/plugins/sqldrivers/psql/CMakeLists.txt
@@ -24,3 +24,14 @@ qt_internal_add_plugin(QPSQLDriverPlugin
#### Keys ignored in scope 1:.:.:psql.pro:<TRUE>:
# OTHER_FILES = "psql.json"
+
+# PostgreSQL delivers header files that are not a part of PostgreSQL itself. When precompiled
+# headers are processed, MinGW uses 'pthread.h' from the PostgreSQL installation directory.
+# As result, we disable precompile headers for the plugin.
+# See also QTBUG-90850.
+if(MINGW)
+ set_target_properties(QPSQLDriverPlugin
+ PROPERTIES
+ DISABLE_PRECOMPILE_HEADERS ON
+ )
+endif()