From 9a9a023b7098b951d63d4914453ef66d461d8118 Mon Sep 17 00:00:00 2001 From: berrux_dev Date: Fri, 18 Sep 2026 17:49:15 +0200 Subject: [PATCH] Links Qt6 WebSockets in httq when module is real --- .../Lts/Common/httq/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/httq/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Common/httq/CMakeLists.txt index 7bddb2883..faaf27b77 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/httq/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/httq/CMakeLists.txt @@ -1,8 +1,16 @@ # Modified CMakeLists.txt from github.com/wille-io/httq # Make ${Qt6_WebSockets} optional -if(QT6_GUI_AVAILABLE AND TARGET Qt6::WebSockets) - set(Qt6_WebSockets ${Qt6_WebSockets}) +# Link the real WebSockets module whenever the websocket code path is +# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual +# Qt6::WebSockets import are set when the real module was found. The old +# QT6_GUI_AVAILABLE condition never held in this environment (Qt6 +# discovery takes the minimal path) and the Qt6_WebSockets variable was +# never defined, so AbstractServer.cpp compiled the websocket code +# without the module on the link line (undefined reference to +# QWebSocketServer::handleConnection). +if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND) + set(Qt6_WebSockets Qt6::WebSockets) else() set(Qt6_WebSockets "") endif()