[gtk-doc/tests-option] Allow disabling the test suite



commit d7cfc57887f62098e2b9e4e40c76b1778fe2fe8f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sun Apr 21 12:54:18 2019 +0100

    Allow disabling the test suite
    
    The GTK-Doc test suite depends on GLib/GObject, which creates a circular
    dependency between GLib and GTK-Doc. By adding an option to build
    GTK-Doc without its test suite, we can break the circular dependency.

 meson.build       | 8 +++++---
 meson_options.txt | 5 ++++-
 tests/meson.build | 3 +++
 3 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/meson.build b/meson.build
index 46277e7..5dcc897 100644
--- a/meson.build
+++ b/meson.build
@@ -32,8 +32,6 @@ pkgconfigdir = join_paths(datadir, 'pkgconfig')
 glib_req = '>= 2.38.0'
 python3_req = '>= 3.4.0'
 
-glib_dep = dependency('glib-2.0', version: glib_req)
-gobject_dep = dependency('gobject-2.0', version: glib_req)
 python3_dep = dependency('python3', version: python3_req)
 
 python_prg = python.find_python()
@@ -144,7 +142,10 @@ configure_file(
 )
 
 subdir('help')
-subdir('tests')
+
+if get_option('tests') == true
+  subdir('tests')
+endif
 
 summary = [
   '',
@@ -162,6 +163,7 @@ summary = [
   '      CMake support: @0@'.format(get_option('cmake_support')),
   '         PDF output: @0@'.format(generate_pdf_output),
   '        User manual: @0@'.format(get_option('yelp_manual')),
+  '         Test suite: @0@'.format(get_option('tests')),
   '------',
 ]
 
diff --git a/meson_options.txt b/meson_options.txt
index ce44377..f1f54a4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -6,4 +6,7 @@ option('cmake_support',
        description: 'Install CMake macros')
 option('yelp_manual',
        type: 'boolean', value: true,
-       description: 'Build the user manual (requires yelp-tools)')
\ No newline at end of file
+       description: 'Build the user manual (requires yelp-tools)')
+option('tests',
+       type: 'boolean', value: true,
+       description: 'Build the test suite (requires glib)')
diff --git a/tests/meson.build b/tests/meson.build
index b48f978..e291c40 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,3 +1,6 @@
+glib_dep = dependency('glib-2.0', version: glib_req)
+gobject_dep = dependency('gobject-2.0', version: glib_req)
+
 glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
 glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
 


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