From: Thomas Debesse Date: Sun, 19 Feb 2023 15:40:28 +0000 (+0100) Subject: radiant: force -lOpenGL -lGL when building with OpenGL_GL_PREFERENCE=GLVND, <3 SpiKe X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=154772140a25f808acd01f9f6701717fe2b2fe18;p=xonotic%2Fnetradiant.git radiant: force -lOpenGL -lGL when building with OpenGL_GL_PREFERENCE=GLVND, <3 SpiKe --- diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index bbf72ed4..01504141 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -155,4 +155,23 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" target_link_libraries(${RADIANT_BASENAME} -no-pie) endif() +if(NOT WIN32 AND NOT APPLE) + if(GTK_TARGET EQUAL 3) + if(OpenGL_GL_PREFERENCE STREQUAL "GLVND") + # This should not be needed, as FindOpenGL should take care of + # this, but maybe GTK rewrites this badly? + + # If not -lOpenGL: + # /usr/bin/ld: CMakeFiles/netradiant.dir/qgl.cpp.o: in function `QGL_sharedContextCreated(OpenGLBinding&)': + # qgl.cpp:(.text+0x1c52): undefined reference to `glAccum' + + # If not -lGL: + # /usr/bin/ld: CMakeFiles/netradiant.dir/qgl.cpp.o: in function `QGL_Shutdown(OpenGLBinding&)': + # qgl.cpp:(.text+0x2d): undefined reference to `glXQueryExtension' + + target_link_libraries(${RADIANT_BASENAME} -lOpenGL -lGL) + endif() + endif() +endif() + copy_dlls(${RADIANT_BASENAME})