From 7aa8afa9d7ccce21bbead9e558c68d2a5aa2c4f3 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 21 Oct 2024 07:24:24 +0200 Subject: [PATCH] build: Disable MSVC warnings Those 2 warnings happen with legitimate usage, so we don't want to see them. In particular not when using "-Werror" (or the MSVC equivalent "/WX") --- meson.build | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/meson.build b/meson.build index 5804bbfa52..8dc5d9628b 100644 --- a/meson.build +++ b/meson.build @@ -267,6 +267,14 @@ if cc.get_id() == 'msvc' '-D_USE_MATH_DEFINES', required_debug_cflags ] + # Extra warning flags and those that should be disabled because they are too common or + # break features. + test_cflags += [ + '/wd4068', # unknown pragma, triggers for all gcc/clang pragmas + '/wd4116', # breaks G_ALIGNOF() + '/wd4090', # VC2017 is way too aggressive with this + ] + msvc_supported_cflags = cc.get_supported_arguments(test_cflags) if debug required_cflags += required_debug_cflags @@ -339,6 +347,7 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang' 'write-strings', ] + if get_option('buildtype').startswith('debug') foreach warning: extra_warnings test_cflags += '-Werror=@0@'.format(warning) @@ -503,6 +512,7 @@ cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found()) cdata.set('HAVE_PANGOFT', pangoft_dep.found()) if win32_enabled cdata.set('HAVE_PANGOWIN32', pangowin32_dep.found()) + cdata.set('CONST_VTABLE', 1) endif wayland_pkgs = []