summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2019-09-28 17:29:35 +0200
committerChristoph Reiter <reiter.christoph@gmail.com>2019-09-30 17:22:37 +0200
commitefbd35d290d35e37994d441c9f2e4c0dffcd9cec (patch)
tree24f6f060cc812fb1eed1495a8220c157fadfa19d
parent1cb3b2b27f824f3bbdab1a2e3fedf45a39689019 (diff)
downloadgobject-introspection-efbd35d290d35e37994d441c9f2e4c0dffcd9cec.tar.gz
meson: change "doctool" from a boolean to a feature option
Similar to !180 this should prevent devs from not running all tests by accident. This also adds some checks for the required doctool dependencies, mako and markdown.
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--.gitlab-ci/test-msys2-meson.sh2
-rw-r--r--meson.build19
-rw-r--r--meson_options.txt2
-rw-r--r--tests/scanner/meson.build2
-rw-r--r--tools/meson.build2
6 files changed, 25 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 800f07bc..f28c3b67 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,7 +16,7 @@ fedora-x86_64-meson:
CFLAGS: "-Werror"
script:
- python3 -m pip install --user mako markdown
- - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=true -Dgtk_doc=true -Dcairo=enabled -Dpython=python3 _build .
+ - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=enabled -Dgtk_doc=true -Dcairo=enabled -Dpython=python3 _build .
- cd _build
- ninja
- meson test --print-errorlogs --suite=gobject-introspection --no-suite=glib
@@ -43,7 +43,7 @@ fedora-x86_64-python3.5:
PYENV_VERSION: "3.5.6"
script:
- python3 -m pip install --user mako markdown
- - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=true -Dgtk_doc=true -Dcairo=enabled -Dpython=python3 _build .
+ - meson --prefix /usr --libdir /usr/lib64 --buildtype debug -Ddoctool=enabled -Dgtk_doc=true -Dcairo=enabled -Dpython=python3 _build .
- cd _build
- ninja
- meson test --print-errorlogs --suite=gobject-introspection --no-suite=glib
diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh
index 37a0f913..40a3cbce 100644
--- a/.gitlab-ci/test-msys2-meson.sh
+++ b/.gitlab-ci/test-msys2-meson.sh
@@ -38,7 +38,7 @@ export PATH="$HOME/.local/bin:$PATH"
# Passing the full interpreter path works around the issue
PYTHON="$(which python3)"
export CFLAGS="-Werror"
-meson -Dcairo=enabled -Ddoctool=true -Dpython="${PYTHON}" --buildtype debug _build
+meson -Dcairo=enabled -Ddoctool=enabled -Dpython="${PYTHON}" --buildtype debug _build
cd _build
ninja
diff --git a/meson.build b/meson.build
index c71d2d84..6e704776 100644
--- a/meson.build
+++ b/meson.build
@@ -172,7 +172,24 @@ if not cairo_deps_found
warning('Not building with cairo support, not all tests will be run')
endif
-with_doctool = get_option('doctool')
+# doctool
+doctool_option = get_option('doctool')
+
+with_doctool = true
+if doctool_option.disabled()
+ with_doctool = false
+else
+ has_mako = run_command(python, ['-c', 'import mako']).returncode() == 0
+ has_markdown = run_command(python, ['-c', 'import markdown']).returncode() == 0
+ if not has_mako or not has_markdown
+ if doctool_option.enabled()
+ error('doctool requires markdown and mako')
+ else
+ with_doctool = false
+ endif
+ endif
+endif
+
if not with_doctool
warning('Not building with doctool support, not all tests will be run')
endif
diff --git a/meson_options.txt b/meson_options.txt
index 2bf2876f..7bed278d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,7 +2,7 @@ option('cairo', type: 'feature', value : 'auto',
description: 'Use cairo for tests'
)
-option('doctool', type: 'boolean', value : false,
+option('doctool', type: 'feature', value : 'auto',
description: 'Install g-ir-doc-tool and run related tests'
)
diff --git a/tests/scanner/meson.build b/tests/scanner/meson.build
index 022d1829..a82a6135 100644
--- a/tests/scanner/meson.build
+++ b/tests/scanner/meson.build
@@ -521,7 +521,7 @@ foreach gir : test_girs
)
endforeach
-if with_doctool and glib_dep.type_name() == 'pkgconfig'
+if has_girdoctool and glib_dep.type_name() == 'pkgconfig'
foreach language : ['C', 'Python', 'Gjs']
regress_docs = custom_target(
'generate-docs-' + language,
diff --git a/tools/meson.build b/tools/meson.build
index 1fedaa53..418cf3ad 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -38,8 +38,10 @@ foreach tool : tools
endforeach
girscanner = tool_output[0]
+has_girdoctool = false
if with_doctool
girdoctool = tool_output[-1]
+ has_girdoctool = true
endif
custom_c_args = []