From b9a82a8e3c2c028e98483cd84ec89cd1be2b4181 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Wed, 8 Feb 2023 09:38:24 -0300 Subject: [PATCH] make documentation building optional --- meson.build | 21 +++++++++++---------- meson_options.txt | 4 ++++ 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index dae4ed9..b8b534f 100644 --- a/meson.build +++ b/meson.build @@ -11,19 +11,20 @@ project('obelisk', llvm = dependency('llvm', version: '>= 14.0.0', modules : ['core', 'target', 'mcjit', 'nativecodegen'], required : true, method: 'config-tool') -doxygen = find_program('doxygen', required : false) - cdata = configuration_data() cdata.set('VERSION', meson.project_version()) -if find_program('dot', required : false).found() - cdata.set('HAVE_DOT', 'YES') -else - cdata.set('HAVE_DOT', 'NO') -endif - -if doxygen.found() - subdir('doc') +docs_enabled = get_option('docs') +if docs_enabled + doxygen = find_program('doxygen', required : false) + if doxygen.found() + if find_program('dot', required : false).found() + cdata.set('HAVE_DOT', 'YES') + else + cdata.set('HAVE_DOT', 'NO') + endif + subdir('doc') + endif endif subdir('src') diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..a7ab105 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,4 @@ +option('docs', + type: 'boolean', + value: true, + description: 'Build documentation for obelisk')