From 09aff9962a8b07d9d03ebdea00a628f9826b9e2a Mon Sep 17 00:00:00 2001 From: Michael Nosthoff Date: Sat, 7 Nov 2026 23:37:48 +0100 Subject: [PATCH] meson: order GPU compilation after shader header generation (#6590) The shader header custom targets are built by default, but their outputs are not included in the sources of libharfbuzz-gpu. This allows Ninja to compile the GPU sources concurrently with shader header generation. The generator also copies each generated header into the source directory. The GPU sources use quoted includes, which find these source-tree copies first. Since the copy truncates its destination before writing, a compiler running concurrently can read an empty header and report undeclared shader symbols. Collect the shader header targets and add them to the GPU library sources. Meson then orders compilation after those targets have completed, including their copies back into the source tree. Keep the existing build-by-default behavior unchanged. Fixes: b1ad797e5 ("[gpu] Commit stringized shader headers; auto-regenerate like ragel") Assisted-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Michael Nosthoff --- src/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 9a152fca7..93f5d4765 100644 --- a/src/meson.build +++ b/src/meson.build @@ -852,8 +852,9 @@ hb_gpu_shader_sources = [ ] hb_gpu_shader_helper = find_program('gen-gpu-shader-artifacts.py') +hb_gpu_shader_headers = [] foreach p: hb_gpu_shader_sources - custom_target('@0@'.format(p.get(1)), + hb_gpu_shader_headers += custom_target('@0@'.format(p.get(1)), build_by_default: true, input: p.get(0), output: p.get(1), @@ -878,6 +879,7 @@ if not get_option('gpu').disabled() libharfbuzz_gpu = library('harfbuzz-gpu', hb_gpu_sources, + hb_gpu_shader_headers, include_directories: incconfig, dependencies: gpu_deps, link_with: [libharfbuzz],