diff --git a/common/gal/opengl/make_shader_src_h.sh b/common/gal/opengl/make_shader_src_h.sh index 19f6a410f2..9bb4ce4de8 100755 --- a/common/gal/opengl/make_shader_src_h.sh +++ b/common/gal/opengl/make_shader_src_h.sh @@ -8,6 +8,20 @@ SHADER_SRC=( "shader.vert" "shader.frag" ) # Number of shaders SHADERS_NUMBER=${#SHADER_SRC[@]} OUTPUT="shader_src.h" +UPDATE=false + +# Check if it is necessary to regenerate headers +for filename in "${SHADER_SRC[@]}" +do + if [[ $filename -nt $OUTPUT ]]; then + UPDATE=true + fi +done + +if [[ $UPDATE == false ]]; then + echo "Headers are up-to-date." + exit +fi # Prepare GLSL source to be included in C array function processSrc {