From 826b09f0c507fe5321a8534054a4f0b7bdd2699b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 4 Dec 2018 12:00:37 +0100 Subject: Fix build of static plugins with resources This patch reverts 388c4ef9f78c8e. The reason is that it generates a symbol (resource_init_function) based on the name of the pro-file. But if different plugins are built from a pro-file with the same name, you end up linking in many symbols with the same name as well. Which one that ends up being used at runtime will typically depend on the linking order of the plugins. This problem will happen if you build an app for iOS that uses both controls 1 and controls 2. In that case, both QML plugins are built from a "controls.pro" file. At runtime, only one of the plugins will be imported correctly. This patch therefore reverts 388c4ef9f78c8e, but at the same time, to not re-introduce the problem it fixed, we instead genereate both a debug and release version of the plugin_resources.cpp file. That way we can still depend on the TARGET variable for generating both the resource_init_function symbol and the cpp file. Fixes: QTBUG-62647 Fixes: QTBUG-71386 Fixes: QTBUG-72108 Change-Id: I3d8c53132458b30ed9f47a259f1f8e4fa4d44130 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/resources.prf | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mkspecs/features/resources.prf') diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index a25846bd77..48e9f83885 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -73,17 +73,14 @@ for(resource, RESOURCES) { } !isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static { - pluginName = $$lower($$replace(_PRO_FILE_, .*/([^/.]+)\\.[^/.]+, \\1)) - - resource_init_function = $${pluginName}_plugin_resource_init + resource_init_function = $$lower($$basename(TARGET))_plugin_resource_init DEFINES += "QT_PLUGIN_RESOURCE_INIT_FUNCTION=$$resource_init_function" - - RESOURCE_INIT_CPP = $$OUT_PWD/$${pluginName}_plugin_resources.cpp + RESOURCE_INIT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_resources.cpp GENERATED_SOURCES += $$RESOURCE_INIT_CPP QMAKE_DISTCLEAN += $$RESOURCE_INIT_CPP - !build_pass { + isEmpty(BUILDS)|build_pass { RESOURCE_INIT_CONT = \ "// This file is autogenerated by qmake. It contains a function that" \ "// references all resources the plugin includes and the function is" \ -- cgit v1.2.3 From 3a9240428cca2478166f8f005cab663e7846285b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Tue, 27 Nov 2018 21:54:19 +0100 Subject: Wasm: disable resources_big MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Errors out with “No data signature found”. Change-Id: Ia9a38e8c71aef4e090494ed4754f4c14e913b092 Reviewed-by: Oswald Buddenhagen Reviewed-by: hjk --- mkspecs/features/resources.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs/features/resources.prf') diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 48e9f83885..bb2a55b93d 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -108,7 +108,7 @@ rcc.name = RCC ${QMAKE_FILE_IN} rcc.depend_command = $$QMAKE_RCC_DEP -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} rcc.CONFIG += add_inputs_as_makefile_deps dep_lines -!resources_big|ltcg|macx-xcode|contains(TEMPLATE, "vc.*") { +!resources_big|ltcg|macx-xcode|wasm|contains(TEMPLATE, "vc.*") { rcc.output = $$RCC_DIR/$${first(QMAKE_MOD_RCC)}_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_CPP)} rcc.commands = $$QMAKE_RCC $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} -- cgit v1.2.3 From d6d80ff2e925c5c52de498535cfdb808b3bd3670 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 21 Feb 2019 16:43:58 +0100 Subject: Automatic resources: Fix tooling support The files to be put into an auto-generated qrc file must not simply disappear, because IDE users still need to have them in the project tree. So we add them to OTHER_FILES now. Task-number: QTCREATORBUG-20103 Task-number: QTCREATORBUG-20104 Change-Id: I8a9136491f975def7c33385e375c407815ad269a Reviewed-by: hjk Reviewed-by: Joerg Bornemann --- mkspecs/features/resources.prf | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mkspecs/features/resources.prf') diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index bb2a55b93d..b4e0db6445 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -28,6 +28,7 @@ for(resource, RESOURCES) { !exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \ warning("Failure to find: $$resource") qmake_immediate.files += $$resource + OTHER_FILES *= $$resource } RESOURCES -= $$resource next() @@ -57,6 +58,7 @@ for(resource, RESOURCES) { alias = $$relative_path($$file, $$abs_base) resource_file_content += \ "$$xml_escape($$file)" + OTHER_FILES *= $$file } } -- cgit v1.2.3 From d2dff76a4fc2c28bf204db183230ffa1b86cbf43 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 18 Mar 2019 09:51:35 +0100 Subject: Replace instances of - with _ when generating the function name As - cannot be used in a function name but can still be used as part of the TARGET, then we need to make sure that it is replaced to avoid a compile problem. Change-Id: I0b2e465310206e2522ce59235b1592517817d3e2 Reviewed-by: Joerg Bornemann --- mkspecs/features/resources.prf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mkspecs/features/resources.prf') diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index b4e0db6445..fa8ff1fb58 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -75,9 +75,11 @@ for(resource, RESOURCES) { } !isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static { - resource_init_function = $$lower($$basename(TARGET))_plugin_resource_init + pluginBaseName = $$basename(TARGET) + pluginName = $$lower($$replace(pluginBaseName, [-], _)) + resource_init_function = $${pluginName}_plugin_resource_init DEFINES += "QT_PLUGIN_RESOURCE_INIT_FUNCTION=$$resource_init_function" - RESOURCE_INIT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_resources.cpp + RESOURCE_INIT_CPP = $$OUT_PWD/$${pluginName}_plugin_resources.cpp GENERATED_SOURCES += $$RESOURCE_INIT_CPP QMAKE_DISTCLEAN += $$RESOURCE_INIT_CPP -- cgit v1.2.3