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

This commit is contained in:
Maciej Suminski 2013-07-01 15:47:44 +02:00
parent 9e4fe8b410
commit 6dc79cf193
1 changed files with 14 additions and 0 deletions

View File

@ -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 {