diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index b8954509b9..92edeac558 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -57,6 +57,7 @@ #if QT_CONFIG(sessionmanager) # include "qcocoasessionmanager.h" #endif +#include "qcocoawindowmanager.h" #include #include @@ -81,6 +82,11 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpa, "qt.qpa", QtWarningMsg); +// Lives here so that the linker is forced to include the QCocoaWindowManager +// object file also in static builds. +static void initializeWindowManager() { Q_UNUSED(QCocoaWindowManager::instance()); } +Q_CONSTRUCTOR_FUNCTION(initializeWindowManager) + static void logVersionInformation() { if (!lcQpa().isInfoEnabled()) diff --git a/src/plugins/platforms/cocoa/qcocoawindowmanager.mm b/src/plugins/platforms/cocoa/qcocoawindowmanager.mm index bb72fea5e6..71bcecdbc6 100644 --- a/src/plugins/platforms/cocoa/qcocoawindowmanager.mm +++ b/src/plugins/platforms/cocoa/qcocoawindowmanager.mm @@ -116,8 +116,5 @@ void QCocoaWindowManager::modalSessionChanged() } } -static void initializeWindowManager() { Q_UNUSED(QCocoaWindowManager::instance()); } -Q_CONSTRUCTOR_FUNCTION(initializeWindowManager) - QT_END_NAMESPACE