diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 040d7c297cc91bdf1df7a0b9debb210dcd9aff37..72a4509adbc99c8d6be889df89839037712ba007 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,6 +34,7 @@ test: stage: test script: - meson _build . -Db_coverage=true + - ninja -C _build libgsystemservice-doc - ninja -C _build test - ninja -C _build coverage coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/' diff --git a/libgsystemservice/docs/meson.build b/libgsystemservice/docs/meson.build index d4562681eac02b1633e35461fd6d2ac1be173f87..bde3b6ec7ca6c7304b2278a8af90017d05108b83 100644 --- a/libgsystemservice/docs/meson.build +++ b/libgsystemservice/docs/meson.build @@ -24,4 +24,14 @@ gnome.gtkdoc('libgsystemservice', '--ignore-headers=' + ' '.join(['tests']), ], install: not meson.is_subproject(), -) \ No newline at end of file +) + +test('gtkdoc-check', + find_program('gtkdoc-check'), + suite: ['docs'], + env: [ + 'BUILDDIR=' + meson.current_build_dir(), + 'DOC_MODULE=libgsystemservice', + 'DOC_MAIN_SGML_FILE=docs.xml', + ], +) diff --git a/libgsystemservice/meson.build b/libgsystemservice/meson.build index 6a8d2a51e0709316243ea6c617fbcfd4329ca5dd..d5c3211d39fb7ac90b55239e44d2e501dbcb8794 100644 --- a/libgsystemservice/meson.build +++ b/libgsystemservice/meson.build @@ -66,5 +66,7 @@ if not meson.is_subproject() ) endif -subdir('docs') +if get_option('gtk_doc') + subdir('docs') +endif subdir('tests') \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt index c01db721e2223686fdb78ab31f301b704e844104..b2493ecae8b565151982f726e8588ba04c45a690 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,13 @@ # Copyright © 2018 Endless Mobile, Inc. # SPDX-License-Identifier: LGPL-2.1-or-later +option( + 'gtk_doc', + type: 'boolean', + value: true, + description: 'Whether to render the reference documentation (requires gtk-doc)', +) + option( 'installed_tests', type: 'boolean',