diff --git a/CMakeLists.txt b/CMakeLists.txt index 543d102f2e..f863962028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1466,17 +1466,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)