]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Compiler setup
authorFred Morcos <fred.morcos@open-xchange.com>
Mon, 3 Jul 2023 10:32:10 +0000 (12:32 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:24 +0000 (13:28 +0100)
meson/compiler-setup/meson.build [new file with mode: 0644]

diff --git a/meson/compiler-setup/meson.build b/meson/compiler-setup/meson.build
new file mode 100644 (file)
index 0000000..3f12ef9
--- /dev/null
@@ -0,0 +1,13 @@
+# Common compiler setup
+# Outputs: cxx system
+
+# Don't limit the number of errors when using clang. This is useful to not cut out the
+# error output when using an LSP server like clangd.
+if meson.get_compiler('cpp').get_id() == 'clang'
+  add_global_arguments(['-ferror-limit=0'], language: 'cpp')
+endif
+
+add_global_arguments(['-Wshadow', '-Wmissing-declarations', '-Wredundant-decls'], language: 'cpp')
+
+cxx = meson.get_compiler('cpp')
+system = target_machine.system()