diff --git a/.ci/build-win.sh b/.ci/build-win.sh index 167f91f48..6ea2c0fbe 100755 --- a/.ci/build-win.sh +++ b/.ci/build-win.sh @@ -34,6 +34,7 @@ meson setup \ -Dgdi=enabled \ -Ddirectwrite=enabled \ -Dgpu=enabled \ + -Dgpu_demo=enabled \ ${BUILD} \ "$@" diff --git a/meson_options.txt b/meson_options.txt index 06186f2b6..cb205869c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') diff --git a/util/gpu/meson.build b/util/gpu/meson.build index eab59fc82..94b07afc8 100644 --- a/util/gpu/meson.build +++ b/util/gpu/meson.build @@ -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()