From db36d010737d5eeceff300e3dd5e315c5d0382a2 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 16 Feb 2022 10:59:33 -0800 Subject: build: Add an option to control building tests Commit 8569c99d2926 ("Look for a Python installation with the tap module") correctly added a dependency on the gi Python module for tests. Commit 51ca035697a4 ("Make tracker:endpoint test work on macOS") restructured Python probing by moving it to the top-level meson.build. These two commits have the side-effect of exposing the fact that the gi Python module is really only a test dependency, and should not be required if building without tests. As such, add a -Dtests=bool option to disable building tests. This reduces the number of ninja targets from 232 to 188 on my non-test build. --- meson.build | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 4e59b8240..f4dd58fd4 100644 --- a/meson.build +++ b/meson.build @@ -75,9 +75,12 @@ if get_option('man') a2x = find_program('a2x') endif -py_modules = ['gi'] -if get_option('tests_tap_protocol') - py_modules += 'tap' +py_modules = [] +if get_option('tests') + py_modules += 'gi' + if get_option('tests_tap_protocol') + py_modules += 'tap' + endif endif python = import('python').find_installation('python3', modules: py_modules) @@ -358,7 +361,9 @@ tracker_uninstalled_nepomuk_ontologies_dir = join_paths(meson.current_source_dir tracker_uninstalled_stop_words_dir = join_paths(meson.current_source_dir(), 'src', 'libtracker-common', 'stop-words') tracker_uninstalled_testutils_dir = join_paths(meson.current_source_dir(), 'utils') -subdir('tests') +if get_option('tests') + subdir('tests') +endif subdir('examples') subdir('po') -- cgit v1.2.1