[gtk/gtk-3-24-meson] meson: Don't make the man pages build depend on the documentation option



commit 8c41c6099dbc38241cbc0972d517905a5bb8cad7
Author: Christoph Reiter <creiter src gnome org>
Date:   Sun Mar 31 13:22:16 2019 +0200

    meson: Don't make the man pages build depend on the documentation option
    
    Include all meson build files under docs/ and check with get_option() there.

 .gitlab-ci/test-msys2-meson.sh          |  5 ++-
 docs/reference/gdk/meson.build          | 43 ++++++++++----------
 docs/reference/gtk/meson.build          | 71 +++++++++++++++++----------------
 docs/reference/libgail-util/meson.build | 38 +++++++++---------
 docs/reference/meson.build              | 24 ++++++-----
 docs/tools/meson.build                  |  2 +-
 meson.build                             |  7 ++--
 7 files changed, 101 insertions(+), 89 deletions(-)
---
diff --git a/.gitlab-ci/test-msys2-meson.sh b/.gitlab-ci/test-msys2-meson.sh
index 415e793f39..2e5a128f17 100644
--- a/.gitlab-ci/test-msys2-meson.sh
+++ b/.gitlab-ci/test-msys2-meson.sh
@@ -39,7 +39,10 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
 ccache --zero-stats
 ccache --show-stats
 
-meson _build
+meson \
+    -Dman-pages=true \
+    _build
+
 ninja -C _build
 
 ccache --show-stats
diff --git a/docs/reference/gdk/meson.build b/docs/reference/gdk/meson.build
index e84fac07a4..007770f3aa 100644
--- a/docs/reference/gdk/meson.build
+++ b/docs/reference/gdk/meson.build
@@ -154,24 +154,27 @@ if wayland_enabled
   src_dir += [ gdkwayland_inc ]
 endif
 
-configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
+if get_option('documentation')
 
-gnome.gtkdoc('gdk3',
-             mode: 'none',
-             main_xml: 'gdk-docs.sgml',
-             src_dir: src_dir,
-             dependencies: libgdk_dep,
-             gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk3.types'),
-             scan_args: [
-               '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
-               '--ignore-headers=' + ' '.join(private_headers),
-             ],
-             fixxref_args: [
-               '--html-dir=@0@'.format(docpath),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
-               '--extra-dir=@0@'.format(cairo_docpath),
-             ],
-             html_assets: images,
-             install: true)
+    configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
+
+    gnome.gtkdoc('gdk3',
+                 mode: 'none',
+                 main_xml: 'gdk-docs.sgml',
+                 src_dir: src_dir,
+                 dependencies: libgdk_dep,
+                 gobject_typesfile: join_paths(meson.current_source_dir(), 'gdk3.types'),
+                 scan_args: [
+                   '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
+                   '--ignore-headers=' + ' '.join(private_headers),
+                 ],
+                 fixxref_args: [
+                   '--html-dir=@0@'.format(docpath),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
+                   '--extra-dir=@0@'.format(cairo_docpath),
+                 ],
+                 html_assets: images,
+                 install: true)
+endif
diff --git a/docs/reference/gtk/meson.build b/docs/reference/gtk/meson.build
index d179dac518..8e54742fa3 100644
--- a/docs/reference/gtk/meson.build
+++ b/docs/reference/gtk/meson.build
@@ -439,8 +439,6 @@ expand_content_files = [
   'tree_widget.sgml',
 ]
 
-configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
-
 types_conf = configuration_data()
 if os_win32
   types_conf.set('DISABLE_ON_W32', '%')
@@ -454,38 +452,43 @@ else
   types_conf.set('DISABLE_ON_QUARTZ', '')
 endif
 
-gnome.gtkdoc('gtk3',
-             mode: 'none',
-             main_xml: 'gtk-docs.sgml',
-             src_dir: [
-               gtkinc,
-            ],
-             dependencies: libgtk_dep,
-             gobject_typesfile: configure_file(
-               input: 'gtk3.types.in',
-               output: 'gtk3.types',
-               configuration: types_conf,
-             ),
-             scan_args: [
-               '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
-               '--ignore-headers=' + ' '.join(private_headers),
-             ],
-             mkdb_args: [
-               '--default-includes=gtk/gtk.h',
-             ],
-             fixxref_args: [
-               '--html-dir=@0@'.format(docpath),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
-               '--extra-dir=@0@'.format(cairo_docpath),
-               '--extra-dir=@0@'.format(gdkpixbuf_docpath),
-               '--extra-dir=../gdk',
-             ],
-             content_files: content_files,
-             expand_content_files: expand_content_files,
-             html_assets: images,
-             install: true)
+if get_option('documentation')
+
+    configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
+
+    gnome.gtkdoc('gtk3',
+                 mode: 'none',
+                 main_xml: 'gtk-docs.sgml',
+                 src_dir: [
+                   gtkinc,
+                ],
+                 dependencies: libgtk_dep,
+                 gobject_typesfile: configure_file(
+                   input: 'gtk3.types.in',
+                   output: 'gtk3.types',
+                   configuration: types_conf,
+                 ),
+                 scan_args: [
+                   '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
+                   '--ignore-headers=' + ' '.join(private_headers),
+                 ],
+                 mkdb_args: [
+                   '--default-includes=gtk/gtk.h',
+                 ],
+                 fixxref_args: [
+                   '--html-dir=@0@'.format(docpath),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
+                   '--extra-dir=@0@'.format(cairo_docpath),
+                   '--extra-dir=@0@'.format(gdkpixbuf_docpath),
+                   '--extra-dir=../gdk',
+                 ],
+                 content_files: content_files,
+                 expand_content_files: expand_content_files,
+                 html_assets: images,
+                 install: true)
+endif
 
 xsltproc = find_program('xsltproc', required: false)
 if get_option('man-pages') and not xsltproc.found()
diff --git a/docs/reference/libgail-util/meson.build b/docs/reference/libgail-util/meson.build
index dea5ecc597..870c3c2482 100644
--- a/docs/reference/libgail-util/meson.build
+++ b/docs/reference/libgail-util/meson.build
@@ -1,19 +1,21 @@
-configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
+if get_option('documentation')
+    configure_file(input: 'version.xml.in', output: 'version.xml', configuration: version_conf)
 
-gnome.gtkdoc('gail-libgail-util3',
-             mode: 'none',
-             main_xml: 'gail-libgail-util-docs.sgml',
-             src_dir: libgailutilinc,
-             dependencies: [libgtk_dep, libgailutil],
-             gobject_typesfile: join_paths(meson.current_source_dir(), 'gail-libgail-util3.types'),
-             scan_args: [
-               '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
-             ],
-             fixxref_args: [
-               '--html-dir=@0@'.format(docpath),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
-               '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
-               '--extra-dir=../gtk',
-             ],
-             install: true)
+    gnome.gtkdoc('gail-libgail-util3',
+                 mode: 'none',
+                 main_xml: 'gail-libgail-util-docs.sgml',
+                 src_dir: libgailutilinc,
+                 dependencies: [libgtk_dep, libgailutil],
+                 gobject_typesfile: join_paths(meson.current_source_dir(), 'gail-libgail-util3.types'),
+                 scan_args: [
+                   '--ignore-decorators=_GDK_EXTERN|G_GNUC_WARN_UNUSED_RESULT',
+                 ],
+                 fixxref_args: [
+                   '--html-dir=@0@'.format(docpath),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
+                   '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
+                   '--extra-dir=../gtk',
+                 ],
+                 install: true)
+endif
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 3edf5f7d6d..23c4e22367 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -1,19 +1,21 @@
-glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
-glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
+if get_option('documentation')
+    glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
+    glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
 
-cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix')
-cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo')
+    cairo_prefix = dependency('cairo-gobject').get_pkgconfig_variable('prefix')
+    cairo_docpath = join_paths(cairo_prefix, 'share', 'gtk-doc', 'html', 'cairo')
 
-gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix')
-gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf')
+    gdkpixbuf_prefix = dependency('gdk-pixbuf-2.0').get_pkgconfig_variable('prefix')
+    gdkpixbuf_docpath = join_paths(gdkpixbuf_prefix, 'share', 'gtk-doc', 'html', 'gdk-pixbuf')
 
-docpath = join_paths(gtk_datadir, 'gtk-doc', 'html')
+    docpath = join_paths(gtk_datadir, 'gtk-doc', 'html')
 
-version_conf = configuration_data()
-version_conf.set('GTK_VERSION', meson.project_version())
+    version_conf = configuration_data()
+    version_conf.set('GTK_VERSION', meson.project_version())
 
-src_dir_conf = configuration_data()
-src_dir_conf.set('SRC_DIR', meson.source_root())
+    src_dir_conf = configuration_data()
+    src_dir_conf.set('SRC_DIR', meson.source_root())
+endif
 
 subdir('gdk')
 subdir('gtk')
diff --git a/docs/tools/meson.build b/docs/tools/meson.build
index 05621ee7ed..5de632f141 100644
--- a/docs/tools/meson.build
+++ b/docs/tools/meson.build
@@ -1,4 +1,4 @@
-if x11_enabled
+if x11_enabled and get_option('documentation')
   doc_shooter_sources = [
     'shadow.c',
     'shooter.c',
diff --git a/meson.build b/meson.build
index 7dbb728ca5..2142509d2c 100644
--- a/meson.build
+++ b/meson.build
@@ -877,10 +877,8 @@ endif
 
 subdir('po')
 subdir('po-properties')
-if get_option('documentation')
-  subdir('docs/tools')
-  subdir('docs/reference')
-endif
+subdir('docs/tools')
+subdir('docs/reference')
 
 install_data('m4macros/gtk-3.0.m4', install_dir: join_paths(get_option('datadir'), 'aclocal'))
 
@@ -903,6 +901,7 @@ summary = [
   '    Colord support: @0@'.format(get_option('colord')),
   '     Introspection: @0@'.format(get_option('introspection')),
   '     Documentation: @0@'.format(get_option('documentation')),
+  '         Man pages: @0@'.format(get_option('man-pages')),
   '       Build tests: @0@'.format(get_option('build-tests')),
   '             Demos: @0@'.format(get_option('demos')),
   '          Examples: @0@'.format(get_option('build-examples')),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]