From: Fred Morcos Date: Thu, 6 Jul 2023 12:09:16 +0000 (+0200) Subject: Meson: Clean up some boost and unit test handling X-Git-Tag: rec-5.1.0-alpha1~80^2~345 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7c65f82c1968376cf8b6033562cb89d5559f30f;p=thirdparty%2Fpdns.git Meson: Clean up some boost and unit test handling --- diff --git a/meson.build b/meson.build index 6f92fa07d3..ead054a8de 100644 --- a/meson.build +++ b/meson.build @@ -59,14 +59,17 @@ endif # Boost Program Options library dep_boost_program_options = dependency('boost', modules: ['program_options'], required: true) -summary('Boost Program Options', dep_boost_program_options.found(), bool_yn: true, section: 'Boost') +deps += dep_boost_program_options +summary('Program Options', dep_boost_program_options.found(), bool_yn: true, section: 'Boost') # Backend Unit Tests opt_backend_unittests = get_option('backend-unit-tests') dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: opt_backend_unittests) -conf.set10('BACKEND_UNIT_TESTS', dep_boost_test.found(), description: 'Whether backend unit tests are enabled') -# There's no need for a summary() here because the summary regarding the Boost.Test -# framework was already printed as part of the meson/unit-tests subdir. +deps += dep_boost_test +conf.set10('BACKEND_UNIT_TESTS', opt_backend_unittests, description: 'Whether backend unit tests are enabled') +if not opt_unittests + summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost') +endif # Sqlite3 opt_sqlite3 = get_option('sqlite3') diff --git a/meson/boost/meson.build b/meson/boost/meson.build index f5a11c44fb..f8e15babe2 100644 --- a/meson/boost/meson.build +++ b/meson/boost/meson.build @@ -1,9 +1,10 @@ # Boost -# Inputs: conf +# Inputs: conf deps dep_boost = dependency('boost', version: '>= 1.42', required: true) +deps += dep_boost # Boost accumulators, as used by dnsbulktest and dnstcpbench, need 1.48+ to be compatible # with C++11. conf.set10('HAVE_BOOST_GE_148', dep_boost.version().version_compare('>= 1.48.0'), description: 'Whether the boost version is >= 1.48.0') summary('Boost', dep_boost.found(), bool_yn: true, section: 'Configuration') -summary('Boost Version', dep_boost.version(), section: 'Boost') +summary('Version', dep_boost.version(), section: 'Boost') diff --git a/meson/unit-tests/meson.build b/meson/unit-tests/meson.build index 40c56c09b2..bacb14f596 100644 --- a/meson/unit-tests/meson.build +++ b/meson/unit-tests/meson.build @@ -1,7 +1,11 @@ # Unit Tests -# Inputs: conf +# Inputs: conf deps +# Outputs: opt_unittests opt_unittests = get_option('unit-tests') dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: opt_unittests) -conf.set10('UNIT_TESTS', dep_boost_test.found(), description: 'Whether unit tests are enabled') -summary('Boost Test', dep_boost_test.found(), bool_yn: true, section: 'Boost') +deps += dep_boost_test +conf.set10('UNIT_TESTS', opt_unittests, description: 'Whether unit tests are enabled') +if opt_unittests + summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost') +endif