From 3e41addbd0f22024f63cc9c3fbef04ca16f05364 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 9 Dec 2024 11:21:38 -0500 Subject: [PATCH 1/2] Add a build option to disable tests This is useful when using gobject-introspection as a subproject in ci. Fixes: #529 --- meson.build | 2 +- meson_options.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ede549f7f..abac63db2 100644 --- a/meson.build +++ b/meson.build @@ -272,7 +272,7 @@ subdir('docs') # The tests will also run, which is not possible if they # were built for a different architecture. -if not meson.is_cross_build() +if not meson.is_cross_build() and get_option('tests') subdir('tests') endif diff --git a/meson_options.txt b/meson_options.txt index dff9be8ec..33b4f741d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -45,3 +45,7 @@ option('build_introspection_data', type: 'boolean', value : true, option('gi_cross_pkgconfig_sysroot_path', type: 'string', description: 'Specify a sysroot path to prepend to pkgconfig output (useful when cross-compiling)' ) + +option('tests', type: 'boolean', value: true, + description: 'Run tests' +) -- GitLab From 90e1b9b9830835051f3774a4bec5f285d595b5f5 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 11 Dec 2024 00:57:35 +0000 Subject: [PATCH 2/2] Apply review feedback --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 33b4f741d..cbc63ed74 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -47,5 +47,5 @@ option('gi_cross_pkgconfig_sysroot_path', type: 'string', ) option('tests', type: 'boolean', value: true, - description: 'Run tests' + description: 'Build and run tests' ) -- GitLab