summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-05-12 11:30:57 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-05-12 14:23:49 +0900
commit8f4d840876dc2c658f7ec5253ca13c0de60175a8 (patch)
tree5afd2aa17a4749031ac3844ea1b5b5b0b3f47da5
parent1501b791a73b50627f154f9176b51deaf501e093 (diff)
Evas GL common: Skip shaders generation if there is no change
Based on a quick git diff we check that the glsl code has not changed. This should fix out-of-tree builds and avoid all source modification unless required. When compiling from a tarball there should be no git tree (err 129), or if there's one the files should not be checked in (ie. no diff). If you changed the glsl files in a tarball... too bad for you. If this is still not enough to fix the build, then go ahead and disable the script from Makefile_Evas.am I would like to note that the auto-generation during make is extremely useful when working on the shaders, which is why I'd rather keep it enabled. @fix
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_enum.x3
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x3
-rwxr-xr-xsrc/modules/evas/engines/gl_common/shader/gen_shaders.sh12
-rw-r--r--src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x3
-rwxr-xr-xsrc/modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh10
5 files changed, 22 insertions, 9 deletions
diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x b/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
index 4f3cb12aa6..e30184eb42 100644
--- a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
+++ b/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
@@ -1,5 +1,4 @@
1/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED 1/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
2 * See: ./modules/evas/engines/gl_common/shader/gen_shaders.sh */
3 2
4typedef enum { 3typedef enum {
5 SHADER_RECT, 4 SHADER_RECT,
diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
index a14c527d38..d1a3cc646b 100644
--- a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
+++ b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
@@ -1,5 +1,4 @@
1/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED 1/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
2 * See: ./modules/evas/engines/gl_common/shader/gen_shaders.sh */
3 2
4#include "../evas_gl_private.h" 3#include "../evas_gl_private.h"
5 4
diff --git a/src/modules/evas/engines/gl_common/shader/gen_shaders.sh b/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
index 677aaabb7e..7b0f74173d 100755
--- a/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
+++ b/src/modules/evas/engines/gl_common/shader/gen_shaders.sh
@@ -35,6 +35,14 @@ precision mediump float;
35#endif 35#endif
36" 36"
37 37
38# Skip generation if there is no diff (or no git)
39if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
40if git diff --quiet --exit-code -- "$DIR"
41then
42 touch "${OUTPUT}" "${OUTPUT_ENUM}"
43 exit 0
44fi
45
38function upper() { 46function upper() {
39 echo $@ |tr '[:lower:]' '[:upper:]' 47 echo $@ |tr '[:lower:]' '[:upper:]'
40} 48}
@@ -50,7 +58,7 @@ IFS=$'\n' SHADERS=(`cat ${DIR}/shaders.txt`)
50IFS=$OIFS 58IFS=$OIFS
51 59
52# Write header 60# Write header
53printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n" > ${OUTPUT} 61printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n\n" > ${OUTPUT}
54 62
55# Including private for hilights and stuff :) 63# Including private for hilights and stuff :)
56printf "#include \"../evas_gl_private.h\"\n\n" >> ${OUTPUT} 64printf "#include \"../evas_gl_private.h\"\n\n" >> ${OUTPUT}
@@ -164,7 +172,7 @@ static const struct {
164 172
165printf "${shaders_source}};\n\n" >> ${OUTPUT} 173printf "${shaders_source}};\n\n" >> ${OUTPUT}
166 174
167printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */ 175printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
168 176
169typedef enum { 177typedef enum {
170${shaders_enum} SHADER_LAST 178${shaders_enum} SHADER_LAST
diff --git a/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x b/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x
index 62e26265da..54c0acba70 100644
--- a/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x
+++ b/src/modules/evas/engines/gl_common/shader_3d/evas_gl_3d_shaders.x
@@ -1,5 +1,4 @@
1/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED 1/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */
2 * See: modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh */
3 2
4static const char vertex_color_vert_glsl[] = 3static const char vertex_color_vert_glsl[] =
5 "#ifdef GL_ES\n" 4 "#ifdef GL_ES\n"
diff --git a/src/modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh b/src/modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh
index 01aea2ae84..6637dd9638 100755
--- a/src/modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh
+++ b/src/modules/evas/engines/gl_common/shader_3d/gen_shaders_3d.sh
@@ -6,6 +6,14 @@ DIR=`dirname $0`
6 6
7OUTPUT=${DIR}/evas_gl_3d_shaders.x 7OUTPUT=${DIR}/evas_gl_3d_shaders.x
8 8
9# Skip generation if there is no diff (or no git)
10if ! git rev-parse 2>> /dev/null >> /dev/null ; then exit 0 ; fi
11if git diff --quiet --exit-code -- "$DIR"
12then
13 touch "${OUTPUT}"
14 exit 0
15fi
16
9exec 1<&- 17exec 1<&-
10exec 1>${OUTPUT} 18exec 1>${OUTPUT}
11 19
@@ -14,7 +22,7 @@ vert_shaders_source=""
14frag_shaders_source="" 22frag_shaders_source=""
15 23
16# Write header 24# Write header
17printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED\n * See: $0 */\n\n" 25printf "/* DO NOT MODIFY THIS FILE AS IT IS AUTO-GENERATED */\n\n"
18for shd in ${SHADERS} ; do 26for shd in ${SHADERS} ; do
19 lname=`basename ${shd} .shd` 27 lname=`basename ${shd} .shd`
20 28