]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Cleanup the handling of unit tests and extra tools
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 17 Oct 2023 18:49:30 +0000 (20:49 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:52 +0000 (13:28 +0100)
meson.build
meson/auth-backend-unit-tests/meson.build [deleted file]
meson/auth-tools/meson.build [deleted file]
meson/boost-test/meson.build [new file with mode: 0644]
meson/ixfrdist/meson.build [deleted file]
meson/unit-tests/meson.build [deleted file]

index b28c9f4850fa00e3d931833be5f4c77c7d445b04..fda914fadb7930c477b0d40dffe80aaa33ca4055 100644 (file)
@@ -57,16 +57,12 @@ 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' / 'unit-tests')              # Unit Tests
-subdir('meson' / 'auth-backend-unit-tests') # Auth Backend Unit Tests
 subdir('meson' / 'reproducible')            # Reproducible Builds
 subdir('meson' / 'fuzz-targets')            # Fuzzing Targets
 subdir('meson' / 'dlopen')                  # dlopen
 subdir('meson' / 'verbose-logging')         # Verbose Logging
 subdir('meson' / 'pkcs11')                  # PKCS11
 subdir('meson' / 'gss-tsig')                # GSS-TSIG
-subdir('meson' / 'auth-tools')              # Tools
-subdir('meson' / 'ixfrdist')                # Ixfrdist
 subdir('meson' / 'systemd')                 # Systemd and unit file handling
 subdir('meson' / 'code-coverage')           # Code coverage
 subdir('meson' / 'auto-var-init')           # Automatic Variable Initialization
@@ -76,6 +72,14 @@ 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
+
 # Manpages
 # if not fs.exists('docs' / 'pdns_server.1') and not python_have_venv
 #   warning('Python3 and/or its venv module is not available and ' +
@@ -104,12 +108,9 @@ deps = [
   dep_rt,
   dep_boost,
   dep_boost_program_options,
-  dep_unittests,
-  dep_backend_unittests,
   dep_dlopen,
   dep_pkcs11,
   dep_gss_tsig,
-  dep_ixfrdist,
   dep_yahttp,
   dep_ipcrypt,
   dep_json11,
@@ -130,7 +131,7 @@ all_modules = {
   'lua2':     {'deps': [],                              'exts': []},
   'remote':   {'deps': ['prog-curl', 'zeromq'],         'exts': []},
   'tinydns':  {'deps': ['cdb'],                         'exts': []},
-  'geoip':    {'deps': ['geoip', 'mmdb', 'yaml-cpp'],   'exts': []},
+  'geoip':    {'deps': ['geoip', 'mmdb'],               'exts': []},
   'lmdb':     {'deps': ['lmdb', 'boost-serialization'], 'exts': ['lmdb-safe']},
 }
 
@@ -146,7 +147,7 @@ foreach module_name, module_props: all_modules
   foreach dep: module_deps
     if module_name == 'remote'
       if dep == 'prog-curl'
-        if not opt_unittests
+        if not get_option('unit-tests')
           continue                # We only need cURL for unit tests.
         endif
       elif dep == 'zeromq'
diff --git a/meson/auth-backend-unit-tests/meson.build b/meson/auth-backend-unit-tests/meson.build
deleted file mode 100644 (file)
index 4ddf0b5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-opt_backend_unittests = get_option('unit-tests-backends')
-dep_backend_unittests = dependency('', required: false)
-
-conf.set('BACKEND_UNIT_TESTS', opt_backend_unittests, description: 'Backend unit tests')
-
-if opt_backend_unittests
-  dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true)
-
-  if not dep_unittests.found()
-    summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost')
-  endif
-
-  dep_backend_unittests = declare_dependency(dependencies: dep_boost_test)
-endif
diff --git a/meson/auth-tools/meson.build b/meson/auth-tools/meson.build
deleted file mode 100644 (file)
index ca0f5fa..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-opt_tools = get_option('tools')
-conf.set('TOOLS', opt_tools, description: 'Build the extra tools')
-summary('Build `tools`', opt_tools, bool_yn: true, section: 'Configuration')
diff --git a/meson/boost-test/meson.build b/meson/boost-test/meson.build
new file mode 100644 (file)
index 0000000..1af8127
--- /dev/null
@@ -0,0 +1,2 @@
+dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true)
+summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost')
diff --git a/meson/ixfrdist/meson.build b/meson/ixfrdist/meson.build
deleted file mode 100644 (file)
index 61e2706..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-opt_ixfrdist = get_option('tools-ixfrdist')
-dep_ixfrdist = dependency('', required: false)
-
-if opt_ixfrdist
-  dep_yaml_cpp = dependency('yaml-cpp', version: '>= 0.5', required: true)
-  dep_ixfrdist = declare_dependency(dependencies: dep_yaml_cpp)
-endif
-
-conf.set('IXFRDIST', dep_ixfrdist.found(), description: 'Whether to build ixfrdist')
-summary('Build `ixfrdist`', dep_ixfrdist.found(), bool_yn: true, section: 'Configuration')
diff --git a/meson/unit-tests/meson.build b/meson/unit-tests/meson.build
deleted file mode 100644 (file)
index 8538401..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-opt_unittests = get_option('unit-tests')
-dep_unittests = dependency('', required: false)
-
-conf.set('UNIT_TESTS', opt_unittests, description: 'Unit tests')
-
-if opt_unittests
-  dep_boost_test = dependency('boost', modules: ['unit_test_framework'], required: true)
-  summary('Test', dep_boost_test.found(), bool_yn: true, section: 'Boost')
-  dep_unittests = declare_dependency(dependencies: dep_boost_test)
-endif