From 25e36eb24e5a966cf32ae8680b6cfb9825eebac8 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 7 Mar 2023 11:08:13 +1000 Subject: [PATCH] meson: move the "build this?" checks into the subdirs Let's decide on what to build in the doc/ and test/ directory rather than in the main file. --- doc/meson.build | 4 ++++ meson.build | 12 +++--------- test/meson.build | 4 ++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index 016484d..aa45c18 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,3 +1,7 @@ +if not get_option('documentation') + subdir_done() +endif + doxygen = find_program('doxygen', required : false) if not doxygen.found() error('Program "doxygen" not found or not executable. Try building with -Ddocumentation=false') diff --git a/meson.build b/meson.build index ae545ab..beae801 100644 --- a/meson.build +++ b/meson.build @@ -62,18 +62,12 @@ config_h.set10('HAVE_LIBXKBCOMMON', dep_libxkbcommon.found()) dep_libevdev = dependency('libevdev', required: false) config_h.set10('HAVE_LIBEVDEV', dep_libevdev.found()) dep_systemd = dependency('libsystemd', required: get_option('liboeffis')) +configure_file(output: 'config.h', configuration: config_h) subdir('proto') subdir('src') subdir('tools') +subdir('test') +subdir('doc') -# tests -if get_option('tests') - subdir('test') -endif -configure_file(output: 'config.h', configuration: config_h) - -if get_option('documentation') - subdir('doc') -endif diff --git a/test/meson.build b/test/meson.build index 3611f11..33aa14a 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,3 +1,7 @@ +if not get_option('tests') + subdir_done() +endif + subproject('munit', default_options: 'werror=false') munit = dependency('munit', fallback: ['munit', 'munit_dep'])