Skip to content

Commit

Permalink
Added check for glslang 15 and if that fails fallback to checking for…
Browse files Browse the repository at this point in the history
… glslang 14.
  • Loading branch information
robertosfield committed Dec 12, 2024
1 parent 7cd17a2 commit e07a9a7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down

0 comments on commit e07a9a7

Please sign in to comment.