Skip to content

Commit

Permalink
Try linking to qoffscreen plugin for static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
oskirby committed Dec 2, 2024
1 parent a8dcc97 commit 33e5215
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/cmake/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ if(Qt6_VERSION VERSION_GREATER_EQUAL 6.5.0)
target_link_libraries(mozillavpn PRIVATE Qt6::GuiPrivate)
endif()

# If we are building statically link to the qoffscreen platform plugin to
# support offscreen rendering via the QT_QPA_PLATFORM=offscreen variable.
if(QT_FEATURE_static)
target_link_libraries(mozillavpn PRIVATE Qt6::QOffscreenIntegrationPlugin)
endif()

if(NOT BUILD_FLATPAK)
# Link to libcap and libsecret
find_package(PkgConfig REQUIRED)
Expand Down
3 changes: 3 additions & 0 deletions src/commands/commandui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@

#include <QApplication>

#if (QT_FEATURE_static > 0)
Q_IMPORT_PLUGIN(qoffscreen);
#endif
Q_IMPORT_QML_PLUGIN(Mozilla_VPNPlugin);

namespace {
Expand Down

0 comments on commit 33e5215

Please sign in to comment.