From e07a9a753facd12f30fe2a782ee51ddc2cf264d1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 12 Dec 2024 11:14:50 +0000 Subject: [PATCH] Added check for glslang 15 and if that fails fallback to checking for glslang 14. --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03383f73f..8486e9f0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,8 +43,16 @@ set(VSG_MAX_INSTRUMENTATION_LEVEL 1 CACHE STRING "Set the instrumentation level # Enable/disable shader compilation support that pulls in glslang set(VSG_SUPPORTS_ShaderCompiler 1 CACHE STRING "Optional shader compiler support, 0 for off, 1 for enabled." ) if (VSG_SUPPORTS_ShaderCompiler) - set(GLSLANG_MIN_VERSION "14" CACHE STRING "glslang 14 is the earliest version that we think installs itself properly on all platforms. Other platforms may be able to use an earlier version") - find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG) + + # Try looking for glslang 15 first. + set(GLSLANG_MIN_VERSION "15" CACHE STRING "glslang 14 is the earliest version that we think installs itself properly on all platforms. Other platforms may be able to use an earlier version") + find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG QUIET) + + if (NOT glslang_FOUND) + # fallback to trying glslang 14. + set(GLSLANG_MIN_VERSION "14") + find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG) + endif() if (glslang_FOUND) set(FIND_DEPENDENCY_glslang "find_package(glslang ${GLSLANG_MIN_VERSION} CONFIG REQUIRED)")