From 6f41c1652f73e1d79d6a4a91d009671a1e285b15 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 19 Dec 2024 10:43:32 +0800 Subject: [PATCH] gui: link with OpenGL framework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qopengl.h pulls in headers from the OpenGL framework on macos when opengl is enabled. We should therefore also link the OpenGL framework. fixes linker error in libqcocoa: Undefined symbols for architecture x86_64: "_glGetIntegerv", referenced from: QCocoaGLContext::updateSurfaceFormat() in libqcocoa.a(qcocoaglcontext.mm.o) "_glGetString", referenced from: QCocoaGLContext::updateSurfaceFormat() in libqcocoa.a(qcocoaglcontext.mm.o) Change-Id: I02d2c80e2652da0cf16eaca7ab161cf711599dc2 Pick-to: 6.9 6.8 6.5 Reviewed-by: Tor Arne Vestbø --- cmake/QtFrameworkHelpers.cmake | 1 + src/gui/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cmake/QtFrameworkHelpers.cmake b/cmake/QtFrameworkHelpers.cmake index 95954d5e0db..50b530ff838 100644 --- a/cmake/QtFrameworkHelpers.cmake +++ b/cmake/QtFrameworkHelpers.cmake @@ -39,6 +39,7 @@ macro(qt_find_apple_system_frameworks) qt_internal_find_apple_system_framework(FWHealthKit HealthKit) qt_internal_find_apple_system_framework(FWUniformTypeIdentifiers UniformTypeIdentifiers) qt_internal_find_apple_system_framework(FWNetwork Network) + qt_internal_find_apple_system_framework(FWOpenGL OpenGL) endif() endmacro() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 2c72123db11..adfb7aeab58 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -400,6 +400,11 @@ qt_internal_extend_target(Gui CONDITION MACOS ${FWAppKit} ) +qt_internal_extend_target(Gui CONDITION MACOS AND QT_FEATURE_opengl + PUBLIC_LIBRARIES + ${FWOpenGL} +) + qt_internal_extend_target(Gui CONDITION UIKIT SOURCES platform/ios/qiosnativeinterface.cpp