summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2021-11-03 10:57:51 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-11-03 11:02:47 +0100
commit1a474db73d5196d07b12bba013bc7db943d95667 (patch)
tree571c047d33a039997826e96975916a02a4a3e1a3 /meson.build
parent72642e8ef66b9aa0cb7cdd0c0d5035d189f5a8a9 (diff)
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. Based on the same fix done in libmbim by Nicolas Cavallari, see https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/commit/792af73ea90e9689703ab526dd444fdb1c2f8e40 Fixes https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/75 (cherry picked from commit 295b75e9c8dc895e281e36b1e8121d09fd556af0)
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build8
1 files changed, 7 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 3cf17ed..5f2091b 100644
--- a/meson.build
+++ b/meson.build
@@ -223,7 +223,12 @@ if enable_gtk_doc
subdir('docs/reference/libqmi-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(
@@ -243,6 +248,7 @@ summary({
'Documentation': enable_gtk_doc,
'bash completion': enable_bash_completion,
'gobject introspection': enable_gir,
+ 'man pages': help2man.found(),
}, section: 'Build')
summary({