From a59e7ec9938cb8a927ea7b02aee8800c36d7d71a Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 15 Sep 2021 14:02:52 +0200 Subject: [PATCH] [meson] Add ragel_subproject option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option to build fallback ragel subproject when no suitable ragel version is found, and make it off by default since most builder don’t need ragel at all. Fixes https://github.com/harfbuzz/harfbuzz/issues/3208 (hopefully) --- meson_options.txt | 2 ++ src/meson.build | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 602d053b7..cd4526ba3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -34,5 +34,7 @@ option('icu_builtin', type: 'boolean', value: false, description: 'Don\'t separate ICU support as harfbuzz-icu module') option('experimental_api', type: 'boolean', value: false, description: 'Enable experimental APIs') +option('ragel_subproject', type: 'boolean', value: false, + description: 'Build Ragel subproject if no suitable version is found') option('fuzzer_ldflags', type: 'string', description: 'Extra LDFLAGS used during linking of fuzzing binaries') diff --git a/src/meson.build b/src/meson.build index 444e61405..e15da3ad3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -291,10 +291,12 @@ hb_gobject_headers = files( ) ragel = find_program('ragel', version: '6.10', required: false) -if not ragel.found() and meson.can_run_host_binaries() and cpp.get_id() != 'msvc' - ragel = subproject('ragel').get_variable('ragel') +has_ragel = ragel.found() +if not has_ragel and get_option('ragel_subproject') + ragel = subproject('ragel').get_variable('ragel') + has_ragel = true endif -if not ragel.found() +if not has_ragel warning('You have to install ragel if you are going to develop HarfBuzz itself') else ragel_helper = find_program('gen-ragel-artifacts.py')