[libgweather/tests-option: 6/7] build: Allow disabling the tests and tools




commit e3e7945cea442500b33585f5432fcb53661e1232
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Oct 16 21:59:02 2021 +0100

    build: Allow disabling the tests and tools
    
    Projects that depend on libgweather and build it as part of their
    Flatpak manifest should have the option to skip building the tests.

 libgweather/meson.build | 6 ++++--
 meson_options.txt       | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libgweather/meson.build b/libgweather/meson.build
index d0a0aff7..8262832f 100644
--- a/libgweather/meson.build
+++ b/libgweather/meson.build
@@ -241,5 +241,7 @@ pkgconfig.generate(
   ],
 )
 
-subdir('tests')
-subdir('tools')
+if get_option('tests')
+  subdir('tests')
+  subdir('tools')
+endif
diff --git a/meson_options.txt b/meson_options.txt
index 0e354dab..bbf5a665 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,3 +8,5 @@ option('gtk_doc', type: 'boolean', value: true,
        description: 'Whether to generate the API reference')
 option('introspection', type: 'boolean', value: true,
        description: 'Whether to generate introspection data')
+option('tests', type: 'boolean', value: true,
+       description: 'Whether to build the tests and tools')


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