darwin: namespace permission request loader function

The dummy function that's used to force the loading of objective-c
classes from a static permission plugin was not properly namespaced. We
name mangle it by appending the qt namespace.

Pick-to: 6.10
Task-number: QTBUG-138543
Change-Id: If8f634720fe1efac8626d4b429397bf463089f98
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tim Blechmann 2025-07-21 15:05:51 +08:00
parent 1beb09f781
commit 714d9dd6d1
2 changed files with 8 additions and 2 deletions

View File

@ -622,7 +622,11 @@ function(qt_internal_add_darwin_permission_plugin permission)
set_property(TARGET ${plugin_target} APPEND PROPERTY
EXPORT_PROPERTIES _qt_darwin_permissison_separate_request
)
set(permission_request_symbol "_QDarwin${permission}PermissionRequest")
if (QT_NAMESPACE)
set(permission_request_symbol "_QDarwin${permission}PermissionRequest_${QT_NAMESPACE}")
else()
set(permission_request_symbol "_QDarwin${permission}PermissionRequest")
endif()
set(permission_request_flag "-Wl,-u,${permission_request_symbol}")
set(has_usage_description_property "_qt_has_${plugin_target}_usage_description")
set(has_usage_description_genex "$<BOOL:$<TARGET_PROPERTY:${has_usage_description_property}>>")

View File

@ -61,7 +61,9 @@ QT_END_NAMESPACE
// Request
#if defined(BUILDING_PERMISSION_REQUEST)
extern "C" void PERMISSION_PLUGIN_NAME(Request)() {}
// dummy symbol to be resolved by the linker to force loading of static library
// (compare -Wl,-u)
extern "C" void QT_MANGLE_NAMESPACE(PERMISSION_PLUGIN_NAME(Request))() { }
#endif
// -------------------------------------------------------