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 <joerg.bornemann@qt.io>
bb10
Andy Shaw 2019-03-18 09:51:35 +01:00
parent 01e1df90a7
commit d2dff76a4f
1 changed files with 4 additions and 2 deletions

View File

@ -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