]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Refactor yaml-cpp handling
authorFred Morcos <fred.morcos@open-xchange.com>
Mon, 27 Nov 2023 10:45:48 +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/yaml-cpp/meson.build

index ac5eb6053de815d931d796ec4066a3852ff3d02d..918c4f5cd047304bacff68c34617aa1249552e62 100644 (file)
@@ -71,10 +71,7 @@ subdir('meson' / 'malloc-trace')            # Malloc-trace
 subdir('meson' / 'socket-dir')              # Socket Dir
 subdir('meson' / 'various-functions')       # Various Functions
 subdir('meson' / 'various-headers')         # Various Headers
-
-if get_option('module-geoip') != 'disabled' or get_option('tools-ixfrdist')
-  subdir('meson' / 'yaml-cpp')
-endif
+subdir('meson' / 'yaml-cpp')                # YAML C++
 
 # Manpages
 # if not fs.exists('docs' / 'pdns_server.1') and not python_have_venv
@@ -121,6 +118,7 @@ deps = [
   dep_luawrapper,
   dep_protozero,
   dep_yahttp,
+  dep_yaml_cpp,
 ]
 
 # Modules
@@ -168,9 +166,6 @@ endforeach
 # Add the sqlite3 dependency for the bind and gsqlite3 backends and pdnsutil.
 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))
-
 subdir('pdns')
 
 selected_modules = []
index 76c5cfb3a8260fefea0ad8483c9bfd1fdb42983d..1457512bb06f5fc480dcac6652c8e9116f5d31ad 100644 (file)
@@ -1,7 +1,21 @@
-dep_yaml_cpp = dependency('yaml-cpp', version: '>= 0.5', required: true)
+dep_yaml_cpp = dependency('', required: false)
 
-summary('YAML-CPP', dep_yaml_cpp.found(), bool_yn: true, section: 'GeoIP Backend')
-if dep_yaml_cpp.found()
-  summary('YAML-CPP Name', dep_yaml_cpp.name(), section: 'GeoIP Backend')
-  summary('YAML-CPP Version', dep_yaml_cpp.version(), section: 'GeoIP Backend')
+if get_option('module-geoip') != 'disabled' or get_option('tools-ixfrdist')
+  dep_yaml_cpp = dependency('yaml-cpp', version: '>= 0.5', required: true)
+endif
+
+if get_option('module-geoip') != 'disabled'
+  summary('YAML-CPP', dep_yaml_cpp.found(), bool_yn: true, section: 'GeoIP Backend')
+  if dep_yaml_cpp.found()
+    summary('YAML-CPP Name', dep_yaml_cpp.name(), section: 'GeoIP Backend')
+    summary('YAML-CPP Version', dep_yaml_cpp.version(), section: 'GeoIP Backend')
+  endif
+endif
+
+if get_option('tools-ixfrdist')
+  summary('YAML-CPP', dep_yaml_cpp.found(), bool_yn: true, section: 'IXFRDist')
+  if dep_yaml_cpp.found()
+    summary('YAML-CPP Name', dep_yaml_cpp.name(), section: 'IXFRDist')
+    summary('YAML-CPP Version', dep_yaml_cpp.version(), section: 'IXFRDist')
+  endif
 endif