summaryrefslogtreecommitdiff
path: root/themes/meson.build
diff options
context:
space:
mode:
authorMatt Kosarek <matt.kosarek@canonical.com>2025-12-29 10:02:38 -0500
committerMatt Kosarek <matt.kosarek@canonical.com>2025-12-29 10:02:38 -0500
commitfbc5d7dd1a9192c29daccdf12a7a067037ff2c2a (patch)
tree399ade27d2e76a40956aa45a789db98841e5ae62 /themes/meson.build
parent301d0aa4d61b21d4daf703672aa4b1d438651296 (diff)
Improve the sun shader with the help of AI
Diffstat (limited to 'themes/meson.build')
-rw-r--r--themes/meson.build24
1 files changed, 24 insertions, 0 deletions
diff --git a/themes/meson.build b/themes/meson.build
index 9c9c76b..1e4c9f1 100644
--- a/themes/meson.build
+++ b/themes/meson.build
@@ -69,6 +69,30 @@ inc = include_directories(
'src/tools'
)
+# Custom target to build shaders from GLSL files
+node = find_program('node')
+shader_script = meson.project_source_root() + '/src/tools/shader.js'
+
+# List all GLSL shader files as inputs
+shader_inputs = files(
+ 'src/_shaders/renderer2d.frag',
+ 'src/_shaders/renderer2d.vert',
+ 'src/_shaders/renderer3d.frag',
+ 'src/_shaders/renderer3d.vert',
+ 'src/_shaders/sun.frag',
+ 'src/_shaders/sun.vert'
+)
+
+# Custom target that runs whenever shader files change
+sh = find_program('sh')
+build_shaders = custom_target('build_shaders',
+ input: shader_inputs,
+ output: 'shaders.stamp',
+ command: [sh, '-c', node.full_path() + ' ' + shader_script + ' && touch @OUTPUT@'],
+ build_always_stale: true,
+ build_by_default: true
+)
+
# Build the executable
output_exe = executable('output',
sources,