CMake: Use glslangValidator executable from Vulkan SDK;
@@ -473,13 +473,18 @@ if(LOVR_ENABLE_GRAPHICS)
add_dependencies(lovr compile_shaders)
function(compile_shaders)
+ if(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE)
+ set(GLSLANG_VALIDATOR "${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE}")
+ else()
+ set(GLSLANG_VALIDATOR "glslangValidator")
+ endif()
file(GLOB shader_files "etc/shaders/*.${ARGV0}")
foreach(shader_file ${shader_files})
string(REGEX MATCH "([^\/]+)\.${ARGV0}" shader ${shader_file})
string(REPLACE ".${ARGV0}" "" shader ${shader})
add_custom_command(TARGET compile_shaders POST_BUILD
COMMAND
- glslangValidator
+ ${GLSLANG_VALIDATOR}
--quiet
--target-env vulkan1.1
--vn lovr_shader_${shader}_${ARGV0}
