Commit 6dc79cf1 authored by Maciej Suminski's avatar Maciej Suminski

Headers are regenerated only if shaders' source code was modified.

parent 9e4fe8b4
...@@ -8,6 +8,20 @@ SHADER_SRC=( "shader.vert" "shader.frag" ) ...@@ -8,6 +8,20 @@ SHADER_SRC=( "shader.vert" "shader.frag" )
# Number of shaders # Number of shaders
SHADERS_NUMBER=${#SHADER_SRC[@]} SHADERS_NUMBER=${#SHADER_SRC[@]}
OUTPUT="shader_src.h" 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 # Prepare GLSL source to be included in C array
function processSrc { function processSrc {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment