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-05 10:57:37 +0000
commit823372ac71fec186e95339179fa01816896bf2f4 (patch)
treeba12760943b6115c15b3341e21f78439ede0f2c8
parentfdb7546d04655562a3915af44b9e5a579bad8591 (diff)
downloadlibmbim-823372ac71fec186e95339179fa01816896bf2f4.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.
-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 3a6fbe6..657b252 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-10-03.1'
+ FDO_DISTRIBUTION_TAG: '2021-11-05.1'
FDO_DISTRIBUTION_PACKAGES: ca-certificates git gcc libgirepository1.0-dev
libglib2.0-dev gtk-doc-tools libglib2.0-doc
gobject-introspection bash-completion valac
- meson ninja-build
+ meson ninja-build help2man
build container:
extends:
@@ -41,7 +41,7 @@ build-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-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-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 011ac75..6f1db9f 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',
@@ -203,7 +203,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')