File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -98,13 +98,18 @@ endif()
9898# Find glslc shader compiler.
9999# On Android, the NDK includes the binary, so no external dependency.
100100if (ANDROID)
101- file (GLOB glslc-folders ${ANDROID_NDK} /shader-tools/*)
101+ file (GLOB glslc_folders ${ANDROID_NDK} /shader-tools/*)
102+ find_program (
103+ GLSL_COMPILER glslc
104+ PATHS ${glslc_folders}
105+ NO_DEFAULT_PATH
106+ )
102107else ()
103- file (GLOB glslc-folders $ENV{VULKAN_SDK} /*)
108+ file (GLOB glslc_folders $ENV{VULKAN_SDK} /*)
109+ find_program (GLSL_COMPILER glslc PATHS ${glslc_folders} )
104110endif ()
105- find_program (CMAKE_GLSL_COMPILER glslc PATHS ${glslc-folders} NO_DEFAULT_PATH)
106- if (CMAKE_GLSL_COMPILER)
107- message (STATUS "Found glslc: ${CMAKE_GLSL_COMPILER} " )
111+ if (GLSL_COMPILER)
112+ message (STATUS "Found glslc: ${GLSL_COMPILER} " )
108113else ()
109114 message (STATUS "Could NOT find glslc, using precompiled .spv files" )
110115endif ()
@@ -114,11 +119,11 @@ function(compile_glsl run_target_name)
114119 foreach (in_file IN LISTS ARGN)
115120 get_filename_component (glsl_stage ${in_file} NAME_WE )
116121 set (out_file ${CMAKE_CURRENT_BINARY_DIR} /${glsl_stage} .spv)
117- if (CMAKE_GLSL_COMPILER )
122+ if (GLSL_COMPILER )
118123 # Run glslc if we can find it
119124 add_custom_command (
120125 OUTPUT ${out_file}
121- COMMAND ${CMAKE_GLSL_COMPILER } -mfmt=c -fshader-stage=${glsl_stage} ${in_file} -o ${out_file}
126+ COMMAND ${GLSL_COMPILER } -mfmt=c -fshader-stage=${glsl_stage} ${in_file} -o ${out_file}
122127 DEPENDS ${in_file}
123128 )
124129 else ()
You can’t perform that action at this time.
0 commit comments