diff options
author | Nicolas Cavallari <nicolas.cavallari@green-communications.fr> | 2021-10-14 12:25:46 +0200 |
---|---|---|
committer | Nicolas Cavallari <nicolas.cavallari@green-communications.fr> | 2021-11-02 09:50:30 +0100 |
commit | 792af73ea90e9689703ab526dd444fdb1c2f8e40 (patch) | |
tree | 652d3af00ed349cbf140a6805336527b2276d6df | |
parent | f6fbc6c2df7cf1e83f06062bb157acbf9ec9ffd8 (diff) |
meson.build: add an option to not build man pages.
When cross-compiling, the compiled binaries cannot be run on the build
machine, unless one defines a helper (e.g. qemu) in the meson
configuration, which is most of the time undesirable.
If help2man is installed on the build machine, then the build would fail
because of this, so add an option to disable generating the man pages.
With later versions of meson, it will be possible to automatically
detect this condition.
-rw-r--r-- | meson.build | 8 | ||||
-rw-r--r-- | meson_options.txt | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 1c5ee2d..59f1727 100644 --- a/meson.build +++ b/meson.build @@ -184,7 +184,12 @@ if enable_gtk_doc subdir('docs/reference/libmbim-glib') endif -help2man = find_program('help2man', required: false) +help2man = find_program( + 'help2man', +# When meson >= 0.59 is popular enough, replace with +# required: get_option('man').require(meson.can_run_host_binaries()) + required: get_option('man'), +) subdir('docs/man', if_found: help2man) configure_file( @@ -198,6 +203,7 @@ summary({ 'Documentation': enable_gtk_doc, 'bash completion': enable_bash_completion, 'gobject introspection': enable_gir, + 'man pages': help2man.found(), }, section: 'Build') summary({ diff --git a/meson_options.txt b/meson_options.txt index 1305957..bfa33ab 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,5 +7,6 @@ option('udevdir', type: 'string', value: '', description: 'where udev base direc option('introspection', type: 'feature', value: 'auto', description: 'build introspection support') option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation') +option('man', type: 'feature', value: 'auto', description: 'build man pages using help2man') option('bash_completion', type: 'boolean', value: true, description: 'install bash completion files') |