summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIñigo Martínez <inigomartinez@gmail.com>2021-11-05 10:06:56 +0100
committerAleksander Morgado <aleksander@aleksander.es>2021-11-08 10:48:15 +0100
commitb917d93708d1d5fed1959507853c77a2bd8b1c83 (patch)
tree11435cd16de38d5be4cf463d34bd1c474090d1b9
parent5fe9d1ebcc7e0c260a8f7b0bb3c1eaf72b2c28d0 (diff)
downloadlibmbim-b917d93708d1d5fed1959507853c77a2bd8b1c83.tar.gz
build: Make feature options boolean
The introspection and man support are set as `feature` but this may cause confusion. They have been made `boolean`. In order to always build man documentation, `help2man` is also installed in the CI builds. (cherry picked from commit 823372ac71fec186e95339179fa01816896bf2f4)
-rw-r--r--.gitlab-ci.yml10
-rw-r--r--docs/man/meson.build2
-rw-r--r--meson.build18
-rw-r--r--meson_options.txt4
4 files changed, 18 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0a4c07d..9430a16 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,11 +12,11 @@ stages:
variables:
FDO_UPSTREAM_REPO: mobile-broadband/libmbim
FDO_DISTRIBUTION_VERSION: '20.04'
- FDO_DISTRIBUTION_TAG: '2021-09-13.1'
+ FDO_DISTRIBUTION_TAG: '2021-11-05.1.MBIM-1.26'
FDO_DISTRIBUTION_PACKAGES: ca-certificates git gcc autoconf automake libtool
libgirepository1.0-dev libglib2.0-dev autopoint
gtk-doc-tools libglib2.0-doc gobject-introspection
- bash-completion valac meson ninja-build
+ bash-completion valac meson ninja-build help2man
build container:
extends:
@@ -41,7 +41,7 @@ build-meson-no-introspection:
- tags
- schedules
script:
- - meson setup build --prefix=/usr -Dwerror=true -Dintrospection=disabled
+ - meson setup build --prefix=/usr -Dwerror=true -Dintrospection=false
- ninja -C build
- ninja -C build install
@@ -56,7 +56,7 @@ build-meson-introspection:
- tags
- schedules
script:
- - meson setup build --prefix=/usr -Dwerror=true -Dintrospection=enabled
+ - meson setup build --prefix=/usr -Dwerror=true
- ninja -C build
- ninja -C build install
@@ -71,7 +71,7 @@ build-meson-release:
- tags
- schedules
script:
- - meson setup build --buildtype=release --prefix=/usr -Dwerror=true -Dintrospection=enabled
+ - meson setup build --buildtype=release --prefix=/usr -Dwerror=true
- ninja -C build
- ninja -C build install
- ninja -C build dist
diff --git a/docs/man/meson.build b/docs/man/meson.build
index f8daf10..d1331de 100644
--- a/docs/man/meson.build
+++ b/docs/man/meson.build
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021 Iñigo Martinez <inigomartinez@gmail.com>
+help2man = find_program('help2man')
+
mans = [
['mbimcli', [help2man, '--output=@OUTPUT@', '--name=Control MBIM devices', '--help-option="--help-all"', mbimcli], [mbimcli_sources]],
['mbim-network', [help2man, '--output=@OUTPUT@', '--name=Simple network management of MBIM devices', mbim_network], []],
diff --git a/meson.build b/meson.build
index 011b5b5..139c37c 100644
--- a/meson.build
+++ b/meson.build
@@ -167,7 +167,10 @@ endif
config_h.set('MBIM_USERNAME_ENABLED', enable_mbim_username)
# introspection support
-enable_gir = dependency('gobject-introspection-1.0', version: '>= 0.9.6', required: get_option('introspection')).found()
+enable_gir = get_option('introspection')
+if enable_gir
+ dependency('gobject-introspection-1.0', version: '>= 0.9.6')
+endif
version_conf = {
'MBIM_MAJOR_VERSION': mbim_major_version,
@@ -184,13 +187,10 @@ if enable_gtk_doc
subdir('docs/reference/libmbim-glib')
endif
-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)
+enable_man = get_option('man')
+if enable_man
+ subdir('docs/man')
+endif
configure_file(
output: 'config.h',
@@ -209,7 +209,7 @@ summary({
'Documentation': enable_gtk_doc,
'bash completion': enable_bash_completion,
'gobject introspection': enable_gir,
- 'man pages': help2man.found(),
+ 'man pages': enable_man,
}, section: 'Build')
summary({
diff --git a/meson_options.txt b/meson_options.txt
index bfa33ab..e768e39 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -5,8 +5,8 @@ option('mbim_username', type: 'string', value: '', description: 'user allowed to
option('udevdir', type: 'string', value: '', description: 'where udev base directory is')
-option('introspection', type: 'feature', value: 'auto', description: 'build introspection support')
+option('introspection', type: 'boolean', value: true, 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('man', type: 'boolean', value: true, description: 'build man pages using help2man')
option('bash_completion', type: 'boolean', value: true, description: 'install bash completion files')