diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-05-06 03:23:27 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-05-06 03:23:27 +0200 |
| commit | ca1fcaca3bc391491111fe951883cb57ac00a61c (patch) | |
| tree | 83cfe4c58396c5af268bd343da2b0b8b2f20bd84 /src/yuzu_cmd | |
| parent | 8f4e8c6d6abc3c85a812891bd3df740dfea7fe7c (diff) | |
[opengl] remove GLAD symbols from builds w/o OpenGL (#3922)
removes unused symbols from non-OpenGL builds, notably mac
I REMEMBER MAKING THIS PR A WHILE AGO but I have no record of it here, so hell lets redo it
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3922
Reviewed-by: crueter <crueter@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Diffstat (limited to 'src/yuzu_cmd')
| -rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 16 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 16 | ||||
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 7 |
3 files changed, 26 insertions, 13 deletions
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 8f92525ad6..35df53f381 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -15,11 +15,18 @@ function(create_resource file output filename) file(WRITE "${PROJECT_BINARY_DIR}/dist/${output}" "const unsigned char ${filename}[] = {${filedata}};\nconst unsigned ${filename}_size = sizeof(${filename});\n") endfunction() +if (ENABLE_OPENGL) + list(APPEND OPENGL_SOURCES + emu_window/emu_window_sdl2_gl.cpp + emu_window/emu_window_sdl2_gl.h + ) +else() + set(OPENGL_SOURCES "") +endif() + add_executable(yuzu-cmd emu_window/emu_window_sdl2.cpp emu_window/emu_window_sdl2.h - emu_window/emu_window_sdl2_gl.cpp - emu_window/emu_window_sdl2_gl.h emu_window/emu_window_sdl2_null.cpp emu_window/emu_window_sdl2_null.h emu_window/emu_window_sdl2_vk.cpp @@ -28,10 +35,13 @@ add_executable(yuzu-cmd sdl_config.h yuzu.cpp yuzu.rc + ${OPENGL_SOURCES} ) target_link_libraries(yuzu-cmd PRIVATE common core input_common frontend_common video_core) -target_link_libraries(yuzu-cmd PRIVATE glad) +if (ENABLE_OPENGL) + target_link_libraries(yuzu-cmd PRIVATE glad) +endif() if (MSVC) target_link_libraries(yuzu-cmd PRIVATE getopt) endif() diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 94a6a69776..448c902131 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp @@ -59,20 +59,16 @@ private: }; bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { - std::vector<std::string_view> unsupported_ext; - + std::vector<std::string_view> unsupported_ext{}; +#ifdef HAS_OPENGL // Extensions required to support some texture formats. - if (!GLAD_GL_EXT_texture_compression_s3tc) { + if (!GLAD_GL_EXT_texture_compression_s3tc) unsupported_ext.push_back("EXT_texture_compression_s3tc"); - } - if (!GLAD_GL_ARB_texture_compression_rgtc) { + if (!GLAD_GL_ARB_texture_compression_rgtc) unsupported_ext.push_back("ARB_texture_compression_rgtc"); - } - - for (const auto& extension : unsupported_ext) { + for (const auto& extension : unsupported_ext) LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", extension); - } - +#endif return unsupported_ext.empty(); } diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 8e518d816c..54cc832bf2 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -31,7 +31,9 @@ #include "sdl_config.h" #include "video_core/renderer_base.h" #include "yuzu_cmd/emu_window/emu_window_sdl2.h" +#ifdef HAS_OPENGL #include "yuzu_cmd/emu_window/emu_window_sdl2_gl.h" +#endif #include "yuzu_cmd/emu_window/emu_window_sdl2_null.h" #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" @@ -349,17 +351,22 @@ int main(int argc, char** argv) { std::unique_ptr<EmuWindow_SDL2> emu_window; switch (Settings::values.renderer_backend.GetValue()) { +#ifdef HAS_OPENGL case Settings::RendererBackend::OpenGL_GLSL: case Settings::RendererBackend::OpenGL_GLASM: case Settings::RendererBackend::OpenGL_SPIRV: emu_window = std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, system, fullscreen); break; +#endif case Settings::RendererBackend::Vulkan: emu_window = std::make_unique<EmuWindow_SDL2_VK>(&input_subsystem, system, fullscreen); break; case Settings::RendererBackend::Null: emu_window = std::make_unique<EmuWindow_SDL2_Null>(&input_subsystem, system, fullscreen); break; + default: + LOG_CRITICAL(Frontend, "Invalid renderer backend"); + return -1; } #ifdef _WIN32 |
