[gpu] Make GL deps optional; add them to Linux CI

The demo requires GLEW, GLFW3, and GL. Make these optional so the
library still builds on headless systems. The demo is skipped when
they're missing.

Install the GL packages in the Linux CI workflow so the demo
builds there.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Behdad EsfahbodandClaude Opus 4.6 committed 2026-03-26 19:14:10 -06:00
1 parent 65d357f808
commit e8d2bddfab
3 files changed
+17 -11

No files matched your search

+3
View File
@@ -36,6 +36,9 @@ jobs:
libgraphite2-dev \
libicu-dev \
libpng-dev \
libglew-dev \
libglfw3-dev \
libgl-dev \
pkg-config \
zlib1g-dev \
help2man
+4 -3
View File
@@ -48,6 +48,7 @@ gpu_demo_generated += custom_target('default font',
capture: true,
command: [ hexify, 'static const char default_font[]', '@INPUT@' ])
glew_dep = dependency('glew', required: true)
glfw_dep = dependency('glfw3', required: true)
gl_dep = dependency('gl', required: true)
glew_dep = dependency('glew', required: false)
glfw_dep = dependency('glfw3', required: false)
gl_dep = dependency('gl', required: false)
have_gpu_demo_deps = glew_dep.found() and glfw_dep.found() and gl_dep.found()
+10 -8
View File
@@ -217,12 +217,14 @@ endif
if not get_option('gpu').disabled()
subdir('gpu')
hb_gpu_util = executable('hb-gpu',
gpu_demo_sources + gpu_demo_generated,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [gl_dep, glew_dep, glfw_dep],
link_with: [libharfbuzz, libharfbuzz_gpu],
install: false,
)
if have_gpu_demo_deps
hb_gpu_util = executable('hb-gpu',
gpu_demo_sources + gpu_demo_generated,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
dependencies: [gl_dep, glew_dep, glfw_dep],
link_with: [libharfbuzz, libharfbuzz_gpu],
install: false,
)
endif
endif