[gpu] Add gpu_demo option, gate deps behind it

GPU library is always built (no deps). GPU demo (hb-gpu) requires
GLEW/GLFW/GL and is controlled by gpu_demo option (auto by default).
When disabled, deps aren't even looked up — fixes MSVC pulling in
broken GLEW wrap. MinGW CI explicitly enables with -Dgpu_demo=enabled.

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-30 15:55:06 -06:00
1 parent 16b1068543
commit d30dc93503
3 files changed
+19 -12

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ meson setup \
-Dgdi=enabled \
-Ddirectwrite=enabled \
-Dgpu=enabled \
-Dgpu_demo=enabled \
${BUILD} \
"$@"
+3 -1
View File
@@ -37,8 +37,10 @@ option('raster', type: 'feature', value: 'enabled',
description: 'Enable HarfBuzz glyph rasterization library')
option('vector', type: 'feature', value: 'enabled',
description: 'Enable HarfBuzz glyph vector drawing library')
option('gpu', type: 'feature', value: 'auto',
option('gpu', type: 'feature', value: 'enabled',
description: 'Enable HarfBuzz GPU rasterization library')
option('gpu_demo', type: 'feature', value: 'auto',
description: 'Build hb-gpu demo (requires GLEW, GLFW, GL)')
option('subset', type: 'feature', value: 'enabled',
description: 'Enable HarfBuzz font subsetting and instancing library')
+15 -11
View File
@@ -33,15 +33,19 @@ if host_machine.system() == 'windows'
)
endif
glew_dep = dependency('glew', required: false)
glfw_dep = dependency('glfw3', required: false)
if host_machine.system() == 'darwin'
gl_dep = dependency('appleframeworks', modules: ['OpenGL'], required: false)
metal_dep = dependency('appleframeworks', modules: ['Metal', 'QuartzCore', 'Foundation', 'AppKit'], required: false)
else
gl_dep = dependency('gl', required: false)
metal_dep = disabler()
gpu_demo_opt = get_option('gpu_demo')
have_gpu_demo_deps = false
if not gpu_demo_opt.disabled()
glew_dep = dependency('glew', required: gpu_demo_opt)
glfw_dep = dependency('glfw3', required: gpu_demo_opt)
if host_machine.system() == 'darwin'
gl_dep = dependency('appleframeworks', modules: ['OpenGL'], required: gpu_demo_opt)
metal_dep = dependency('appleframeworks', modules: ['Metal', 'QuartzCore', 'Foundation', 'AppKit'], required: false)
else
gl_dep = dependency('gl', required: gpu_demo_opt)
metal_dep = disabler()
endif
d3d11_dep = meson.get_compiler('cpp').find_library('d3d11', required: false)
d3dcompiler_dep = meson.get_compiler('cpp').find_library('d3dcompiler_47', required: false)
have_gpu_demo_deps = glew_dep.found() and glfw_dep.found() and gl_dep.found()
endif
d3d11_dep = meson.get_compiler('cpp').find_library('d3d11', required: false)
d3dcompiler_dep = meson.get_compiler('cpp').find_library('d3dcompiler_47', required: false)
have_gpu_demo_deps = glew_dep.found() and glfw_dep.found() and gl_dep.found()