]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Refactor boost test handling
authorFred Morcos <fred.morcos@open-xchange.com>
Mon, 27 Nov 2023 10:45:26 +0000 (11:45 +0100)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:57 +0000 (13:28 +0100)
meson.build
meson/boost-test/meson.build
pdns/meson.build

index 4d7b4e568b4ab960b870aca6960664bfcee97fb7..ac5eb6053de815d931d796ec4066a3852ff3d02d 100644 (file)
@@ -57,6 +57,7 @@ subdir('meson' / 'ipcipher')                # IPCipher
 subdir('meson' / 'clock-gettime')           # Clock_gettime
 subdir('meson' / 'boost')                   # Boost
 subdir('meson' / 'boost-program-options')   # Boost Program Options Library
+subdir('meson' / 'boost-test')              # Boost Testing Library
 subdir('meson' / 'reproducible')            # Reproducible Builds
 subdir('meson' / 'dlopen')                  # dlopen
 subdir('meson' / 'verbose-logging')         # Verbose Logging
@@ -71,10 +72,6 @@ subdir('meson' / 'socket-dir')              # Socket Dir
 subdir('meson' / 'various-functions')       # Various Functions
 subdir('meson' / 'various-headers')         # Various Headers
 
-if get_option('unit-tests') or get_option('unit-tests-backends')
-  subdir('meson' / 'boost-test')
-endif
-
 if get_option('module-geoip') != 'disabled' or get_option('tools-ixfrdist')
   subdir('meson' / 'yaml-cpp')
 endif
@@ -174,9 +171,6 @@ deps += get_variable('dep_sqlite3', dependency('', required: false))
 # Add the yaml-cpp dependency for geoip and ixfrdist.
 deps += get_variable('dep_yaml_cpp', dependency('', required: false))
 
-# Add the boost-test dependency for unit tests and backend unit tests.
-deps += get_variable('dep_boost_test', dependency('', required: false))
-
 subdir('pdns')
 
 selected_modules = []
index 1af8127766f80e177912cdd93dabdac3728894c9..1d7af1e8a00151253fcdd1624fafbf5b67032362 100644 (file)
@@ -1,2 +1,5 @@
-dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true)
-summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost')
+dep_boost_test = dependency('', required: false)
+if get_option('unit-tests') or get_option('unit-tests-backends')
+  dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true)
+  summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost')
+endif
index 8b602801ef111c6a9a4f8fb4b14cb2d9a1dac6f2..b8b80a9923d6c9d454521417887253ee9b709b88 100644 (file)
@@ -1622,6 +1622,7 @@ if get_option('unit-tests')
       ],
       'deps': [
         deps,
+        dep_boost_test,
         libpdns_bind_parser,
         libpdns_dnslabeltext,
         libpdns_pkcs11signers,