Browse Source

Platform: properly link to GLX also if Sdl2/GlfwApplication is disabled.

pull/326/merge
Vladimír Vondruš 7 years ago
parent
commit
76a73bb38d
  1. 36
      src/Magnum/Platform/CMakeLists.txt

36
src/Magnum/Platform/CMakeLists.txt

@ -92,17 +92,27 @@ set(MagnumPlatform_FILES )
install(FILES ${MagnumPlatform_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform) install(FILES ${MagnumPlatform_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
# Decide about platform-specific context for cross-platform toolkits if(TARGET_GL)
if((WITH_GLFWAPPLICATION OR WITH_SDL2APPLICATION) AND TARGET_GL) # Decide about platform-specific context for cross-platform toolkits
if(CORRADE_TARGET_APPLE AND NOT MAGNUM_TARGET_GLES) if(WITH_GLFWAPPLICATION OR WITH_SDL2APPLICATION)
set(NEED_CGLCONTEXT 1) if(CORRADE_TARGET_APPLE AND NOT MAGNUM_TARGET_GLES)
set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumCglContextObjects>) set(NEED_CGLCONTEXT 1)
elseif(CORRADE_TARGET_WINDOWS AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)) set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumCglContextObjects>)
set(NEED_WGLCONTEXT 1) elseif(CORRADE_TARGET_WINDOWS AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES))
set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumWglContextObjects>) set(NEED_WGLCONTEXT 1)
elseif(CORRADE_TARGET_UNIX AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)) set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumWglContextObjects>)
set(NEED_GLXCONTEXT 1) elseif(CORRADE_TARGET_UNIX AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES))
set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumGlxContextObjects>) set(NEED_GLXCONTEXT 1)
set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumGlxContextObjects>)
elseif(MAGNUM_TARGET_GLES AND NOT CORRADE_TARGET_EMSCRIPTEN)
set(NEED_EGLCONTEXT 1)
set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumEglContextObjects>)
# We're linking to EGL explicitly, no need to bother with GLVND there
endif()
endif()
# This is needed also by [Windowless]GlxApplication
if((WITH_GLXAPPLICATION OR WITH_WINDOWLESSGLXAPPLICATION OR WITH_GLFWAPPLICATION OR WITH_SDL2APPLICATION) AND CORRADE_TARGET_UNIX AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES))
# If the GLVND library (CMake 3.11+) was found and linked to, we need # If the GLVND library (CMake 3.11+) was found and linked to, we need
# to link to GLX explicitly. Otherwise (and also on all systems except # to link to GLX explicitly. Otherwise (and also on all systems except
# Linux) the transitive dependency to classic GL lib from MagnumGL is # Linux) the transitive dependency to classic GL lib from MagnumGL is
@ -113,10 +123,6 @@ if((WITH_GLFWAPPLICATION OR WITH_SDL2APPLICATION) AND TARGET_GL)
if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND) if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND)
set(MagnumSomeContext_LIBRARY OpenGL::GLX) set(MagnumSomeContext_LIBRARY OpenGL::GLX)
endif() endif()
elseif(MAGNUM_TARGET_GLES AND NOT CORRADE_TARGET_EMSCRIPTEN)
set(NEED_EGLCONTEXT 1)
set(MagnumSomeContext_OBJECTS $<TARGET_OBJECTS:MagnumEglContextObjects>)
# We're linking to EGL explicitly, no need to bother with GLVND there
endif() endif()
endif() endif()

Loading…
Cancel
Save