summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt_functions.prf
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-11-22 21:00:34 -0800
committerThiago Macieira <thiago.macieira@intel.com>2014-12-01 21:33:31 +0100
commitfe6f4b9ad7eff15e6201baea9dad737c792a328c (patch)
tree87405892971b9b8eec7ee2656993b67bbe30cf10 /mkspecs/features/qt_functions.prf
parent2b258dc80b34dc785257efa2292457e32da9408d (diff)
Fix linking of sources without LTCG to a static lib with LTCG
Whenever a binary is created and linked against a static lib that was compiled with LTCG, the final linking step requires the compiler flags so that the pre-compiled data in the shared library can get properly compiled. This could happen for a static build of Qt with LTCG, but also happens frequently for Qt's own build when linking regular libraries and applications against QtBootstrap or QtPlatformSupport. The linking fails when the target is a shared library (example: QtWaylandClient linking against QtPlatformSupport). The .prl file actually contains the "ltcg" flag, so the best solution would actually be to process that flag there and add link_ltcg if any dependent .prl has "ltcg", but I couldn't find out how to do that. Change-Id: I4a75a14d1dcb8c2089a427285e25d5555df7d7d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'mkspecs/features/qt_functions.prf')
-rw-r--r--mkspecs/features/qt_functions.prf1
1 files changed, 1 insertions, 0 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
index a9a622dd1d..7961f6512a 100644
--- a/mkspecs/features/qt_functions.prf
+++ b/mkspecs/features/qt_functions.prf
@@ -68,6 +68,7 @@ defineTest(qtAddModule) {
using_privates = true
export(using_privates)
}
+ contains(MODULE_CONFIG, ltcg): CONFIG += link_ltcg
qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG)
qtProcessModuleFlags(DEFINES, QT.$${1}.DEFINES)