From ff170962d460aafea93373f8c2391716d199adb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 3 Nov 2020 17:00:11 +0100 Subject: Don't rely on the module.pri for the entrypoint linking to the library Depending on the presence and behavior of HEADER_MODULE/header_module in CMake and qmake land, the module.pri might end up with an empty module line, which means adding the module via QT_PRIVATE += entrypoint will not link to the static library. To avoid this problem we write an explicit module entry (QT.foo.bar) into the same module.pri file as the one generated by qt_module, where the auto-generated one has header_module enabled, and hence no link behavior, while the manually written entry has a module component, and will ensure linkage to the static library. Change-Id: Ib98484f74410fab45c4d109f3610028200fba0c5 Reviewed-by: Alexandru Croitor --- mkspecs/features/qt_module_pris.prf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mkspecs/features/qt_module_pris.prf') diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 7a6cc56754..1cf2afcac6 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -154,8 +154,8 @@ defineReplace(qtExportLibsForModule) { $$qtGetExportsForModule($$MODULE_ID) \ "QT_CONFIG +=$$join(QT.$${MODULE_ID}.QT_CONFIG, " ", " ")" \ "" \ - "QT_MODULES += $$MODULE" \ - "$$MODULE_PRI_EXTRA_CONTENT" + "QT_MODULES += $$MODULE" + MODULE_PRI_CONT += $$MODULE_PRI_EXTRA_CONTENT write_file($$MODULE_PRI, MODULE_PRI_CONT)|error() !internal_module:!no_private_module { module_build_type += internal_module -- cgit v1.2.3