aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-12-02 22:23:04 -0500
committerDavid Robillard <d@drobilla.net>2024-12-02 22:48:35 -0500
commit1a49b64024c68e8a1f308c58513a40afaa547f7b (patch)
treeec804f11ccf164456ecd55c1c674322516f1d6b3 /meson.build
parent1cf88611643fe37597a66279dfffcbcbb14b525e (diff)
downloadlv2-1a49b64024c68e8a1f308c58513a40afaa547f7b.tar.xz
Clean up warning suppressions
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build42
1 files changed, 27 insertions, 15 deletions
diff --git a/meson.build b/meson.build
index 3453ba0..90fad9a 100644
--- a/meson.build
+++ b/meson.build
@@ -42,8 +42,8 @@ warning_level = get_option('warning_level')
# C
c_suppressions = []
-if warning_level == 'everything'
- if cc.get_id() in ['clang', 'emscripten']
+if cc.get_id() in ['clang', 'emscripten']
+ if warning_level == 'everything'
c_suppressions += [
'-Wno-bad-function-cast',
'-Wno-cast-align',
@@ -71,8 +71,14 @@ if warning_level == 'everything'
if host_machine.system() == 'windows'
c_suppressions += ['-Wno-format-nonliteral']
endif
+ endif
- elif cc.get_id() == 'gcc'
+ if warning_level in ['everything', '3', '2']
+ c_suppressions += ['-Wno-unused-parameter']
+ endif
+
+elif cc.get_id() == 'gcc'
+ if warning_level == 'everything'
c_suppressions += [
'-Wno-bad-function-cast',
'-Wno-cast-align',
@@ -94,12 +100,17 @@ if warning_level == 'everything'
if target_machine.system() == 'windows'
c_suppressions += ['-Wno-suggest-attribute=format']
endif
+ endif
+
+ if warning_level in ['everything', '3', '2']
+ c_suppressions += ['-Wno-unused-parameter']
+ endif
- elif cc.get_id() == 'msvc'
+elif cc.get_id() == 'msvc'
+ if warning_level == 'everything'
c_suppressions += [
'/wd4061', # enumerator in switch is not explicitly handled
'/wd4244', # conversion with possible loss of data
- '/wd4267', # conversion from size_t to a smaller type
'/wd4310', # cast truncates constant value
'/wd4365', # signed/unsigned mismatch
'/wd4464', # relative include path contains ".."
@@ -112,16 +123,18 @@ if warning_level == 'everything'
'/wd5045', # will insert Spectre mitigation for memory load
]
endif
-endif
-if cc.get_id() in ['clang', 'emscripten']
- c_suppressions += ['-Wno-unused-parameter']
-elif cc.get_id() == 'gcc'
- c_suppressions += ['-Wno-unused-parameter']
-elif cc.get_id() == 'msvc'
- c_suppressions += [
- '/wd4100', # unreferenced formal parameter
- ]
+ if warning_level in ['everything', '3']
+ c_suppressions += [
+ '/wd4100', # unreferenced formal parameter
+ ]
+ endif
+
+ if warning_level in ['everything', '3', '2']
+ c_suppressions += [
+ '/wd4267', # conversion from size_t to a smaller type
+ ]
+ endif
endif
c_suppressions = cc.get_supported_arguments(c_suppressions)
@@ -181,7 +194,6 @@ if is_variable('cpp')
cpp_suppressions = cpp.get_supported_arguments(cpp_suppressions)
endif
-
##########################
# LV2 Path Configuration #
##########################