diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-11 18:36:41 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-11 18:36:41 +0100 |
commit | e2edd9f141699ce4be1664f590438369db9573e6 (patch) | |
tree | df378e5105ab136c1d394a11b239c88a2806c17f | |
parent | Load assimp textures in parallel (diff) | |
download | ilt-e2edd9f141699ce4be1664f590438369db9573e6.tar.bz2 ilt-e2edd9f141699ce4be1664f590438369db9573e6.tar.xz ilt-e2edd9f141699ce4be1664f590438369db9573e6.zip |
Split out the glsl embedding jam rules
-rw-r--r-- | Jamroot.jam | 24 | ||||
-rw-r--r-- | glsl.jam | 23 |
2 files changed, 24 insertions, 23 deletions
diff --git a/Jamroot.jam b/Jamroot.jam index ebe97a6..2275dd6 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -1,12 +1,10 @@ using gcc ; using pkg-config ; import pkg-config ; -import type : register ; -import type : type ; -import generators : register-standard ; import testing ; import lex ; import sequence ; +import glsl ; pkg-config.import sdl2 ; pkg-config.import glew ; @@ -50,26 +48,6 @@ project : requirements <toolset>tidy:<define>TIDY ; -type.register GL_VERTEX_SHADER : vs ; -type.register GL_GEOMETRY_SHADER : gs ; -type.register GL_FRAGMENT_SHADER : fs ; - -generators.register-standard embed.glsl : GL_VERTEX_SHADER : CPP(vs-%) H(vs-%) ; -generators.register-standard embed.glsl : GL_GEOMETRY_SHADER : CPP(gs-%) H(gs-%) ; -generators.register-standard embed.glsl : GL_FRAGMENT_SHADER : CPP(fs-%) H(fs-%) ; - -actions embed.glsl -{ - m4 -DNAME=$(2:B) -DTYPE=$(2:S) > $(1[2]) lib/embed-glsl.h.m4 - m4 -DSOURCE=$(2) -DNAME=$(2:B) -DTYPE=$(2:S) -DGLTYPE=$(OPTIONS) > $(1[1]) lib/embed-glsl.cpp.m4 -} -rule embed.glsl ( targets * : sources * : properties * ) -{ - DEPENDS $(targets) : lib/embed-glsl.h.m4 lib/embed-glsl.cpp.m4 ; - OPTIONS on $(targets) = [ type.type $(sources) ] ; -} -IMPORT $(__name__) : embed.glsl : : embed.glsl ; - exe iliketrains : application/main.cpp : diff --git a/glsl.jam b/glsl.jam new file mode 100644 index 0000000..03e93e9 --- /dev/null +++ b/glsl.jam @@ -0,0 +1,23 @@ +import type : register ; +import type : type ; +import generators : register-standard ; + +type.register GL_VERTEX_SHADER : vs ; +type.register GL_GEOMETRY_SHADER : gs ; +type.register GL_FRAGMENT_SHADER : fs ; + +generators.register-standard glsl.embed : GL_VERTEX_SHADER : CPP(vs-%) H(vs-%) ; +generators.register-standard glsl.embed : GL_GEOMETRY_SHADER : CPP(gs-%) H(gs-%) ; +generators.register-standard glsl.embed : GL_FRAGMENT_SHADER : CPP(fs-%) H(fs-%) ; + +actions glsl.embed +{ + m4 -DNAME=$(2:B) -DTYPE=$(2:S) > $(1[2]) lib/embed-glsl.h.m4 + m4 -DSOURCE=$(2) -DNAME=$(2:B) -DTYPE=$(2:S) -DGLTYPE=$(OPTIONS) > $(1[1]) lib/embed-glsl.cpp.m4 +} + +rule glsl.embed ( targets * : sources * : properties * ) +{ + DEPENDS $(targets) : lib/embed-glsl.h.m4 lib/embed-glsl.cpp.m4 ; + OPTIONS on $(targets) = [ type.type $(sources) ] ; +} |