[glib: 1/2] build: Add option for disabling tests




commit 04b168846f862171e46466358d883fb0511862f5
Author: Ole André Vadla Ravnås <oleavr gmail com>
Date:   Sat Apr 27 17:04:26 2019 +0200

    build: Add option for disabling tests

 meson.build       | 2 +-
 meson_options.txt | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 05dfff027..cfa4e4972 100644
--- a/meson.build
+++ b/meson.build
@@ -94,7 +94,7 @@ installed_tests_template = files('template.test.in')
 installed_tests_template_tap = files('template-tap.test.in')
 
 # Don’t build the tests unless we can run them (either natively, in an exe wrapper, or by installing them 
for later use)
-build_tests = not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper()) or 
installed_tests_enabled
+build_tests = get_option('tests') and (not meson.is_cross_build() or (meson.is_cross_build() and 
meson.has_exe_wrapper()) or installed_tests_enabled)
 
 add_project_arguments('-D_GNU_SOURCE', language: 'c')
 
diff --git a/meson_options.txt b/meson_options.txt
index af9645eda..a42136f78 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -84,6 +84,11 @@ option('fam',
        value : false,
        description : 'Use fam for file system monitoring')
 
+option('tests',
+       type : 'boolean',
+       value : true,
+       description : 'build tests')
+
 option('installed_tests',
        type : 'boolean',
        value : false,


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