Skip to content

Commit

Permalink
gui: link with OpenGL framework
Browse files Browse the repository at this point in the history
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ø <[email protected]>
  • Loading branch information
timblechmann committed Dec 19, 2024
1 parent d983a40 commit 6f41c16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/QtFrameworkHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
5 changes: 5 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f41c16

Please sign in to comment.