Merge pull request #14007 from JoshuaVandaele/glslang-fix

CMakeLists: Fix compilation of glslang in cases where it hasn't been linked against SPIRV-Tools
This commit is contained in:
JMC47 2025-10-17 18:46:19 -04:00 committed by GitHub
commit 6f81811e32
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -651,7 +651,15 @@ dolphin_find_optional_system_library_pkgconfig(FMT
add_subdirectory(Externals/imgui) add_subdirectory(Externals/imgui)
add_subdirectory(Externals/implot) add_subdirectory(Externals/implot)
dolphin_find_optional_system_library(glslang Externals/glslang 15.0)
# A few distributions (mainly Debian-based ones) distribute glslang without linking it against SPIRV-Tools
find_package(SPIRV-Tools)
if(SPIRV-Tools_FOUND)
dolphin_find_optional_system_library(glslang Externals/glslang 15.0)
target_link_libraries(glslang::glslang INTERFACE SPIRV-Tools)
else()
dolphin_add_bundled_library(glslang OFF Externals/glslang)
endif()
# SPIRV-Cross is used on Windows for GLSL to HLSL conversion for the Direct3D 11 and Direct3D 12 # SPIRV-Cross is used on Windows for GLSL to HLSL conversion for the Direct3D 11 and Direct3D 12
# video backends, and on Apple devices for the Metal video backend. # video backends, and on Apple devices for the Metal video backend.
if(WIN32 OR APPLE) if(WIN32 OR APPLE)