From fe6f4b9ad7eff15e6201baea9dad737c792a328c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 22 Nov 2014 21:00:34 -0800 Subject: 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 --- mkspecs/features/qt_functions.prf | 1 + 1 file changed, 1 insertion(+) (limited to 'mkspecs/features/qt_functions.prf') 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) -- cgit v1.2.3