Skip to content

Commit

Permalink
cmake: use glad glx/egl/wgl only when sdl2 is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam authored and flyinghead committed Dec 1, 2023
1 parent db7895c commit e53433e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1471,17 +1471,16 @@ endif()

if((USE_OPENGL OR USE_GLES2 OR USE_GLES) AND NOT LIBRETRO)
add_library(glad STATIC core/deps/glad/src/gl.c)
if(X11_FOUND)
target_sources(glad PRIVATE core/deps/glad/src/glx.c)
endif()
if(ANDROID OR USE_GLES2 OR USE_GLES)
target_sources(glad PRIVATE core/deps/glad/src/egl.c)
endif()
if(WIN32)
target_sources(glad PRIVATE core/deps/glad/src/wgl.c)
endif()
if(NINTENDO_SWITCH)
target_compile_definitions(glad PRIVATE EGL_NO_PLATFORM_SPECIFIC_TYPES)
if(NOT SDL2_FOUND)
if(X11_FOUND)
target_sources(glad PRIVATE core/deps/glad/src/glx.c)
endif()
if(ANDROID OR USE_GLES2 OR USE_GLES)
target_sources(glad PRIVATE core/deps/glad/src/egl.c)
endif()
if(WIN32)
target_sources(glad PRIVATE core/deps/glad/src/wgl.c)
endif()
endif()
target_include_directories(glad PUBLIC core/deps/glad/include)
target_link_libraries(${PROJECT_NAME} PRIVATE glad)
Expand Down

0 comments on commit e53433e

Please sign in to comment.