diff options
author | Dudemanguy <random342@airmail.cc> | 2021-11-14 18:34:51 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-11-15 16:58:23 +0000 |
commit | dfbaf4dd81cd19779bfa810b0f838a10c3836963 (patch) | |
tree | 95a47d383343c64678ccfe0cc1ecc4ee10846a5c | |
parent | 923c0f03704ed3d5caea089245a9c6ff74071bb0 (diff) | |
download | mpv-dfbaf4dd81cd19779bfa810b0f838a10c3836963.tar.bz2 mpv-dfbaf4dd81cd19779bfa810b0f838a10c3836963.tar.xz |
meson: fix -Werror=format-security flag
This test fails because the compiler object does not have -Wformat when
it tries this flag. To fix this this, we have to pass both -Wformat and
-Werror=format-security at the same time during the test. This requires
us to use has_multi_arguments so this flag needs to be pulled out of
this array and tested separately.
-rw-r--r-- | meson.build | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meson.build b/meson.build index b44b161584..ed48fd6aa0 100644 --- a/meson.build +++ b/meson.build @@ -256,7 +256,6 @@ test_flags = ['-Werror=implicit-function-declaration', '-Wdisabled-optimization', '-Wstrict-prototypes', '-Wno-format-zero-length', - '-Werror=format-security', '-Wno-redundant-decls', '-Wvla', '-Wno-format-truncation', @@ -265,6 +264,10 @@ test_flags = ['-Werror=implicit-function-declaration', flags += cc.get_supported_arguments(test_flags) +if cc.has_multi_arguments('-Wformat', '-Werror=format-security') + flags += '-Werror=format-security' +endif + if cc.get_id() == 'gcc' gcc_flags = ['-Wundef', '-Wmissing-prototypes', '-Wshadow', '-Wno-switch', '-Wparentheses', '-Wpointer-arith', |