From 4a47f1aabc300317a87c581b71e21048416d2c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 1 Dec 2018 11:05:27 +0000 Subject: [PATCH] meson: suppress some spurious compiler warnings with MSVC --- meson.build | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/meson.build b/meson.build index 6d5257a47..176eefb39 100644 --- a/meson.build +++ b/meson.build @@ -5,6 +5,24 @@ project('harfbuzz', 'c', 'cpp', pkgmod = import('pkgconfig') cpp = meson.get_compiler('cpp') +if cpp.get_id() == 'msvc' + # Ignore several spurious warnings for things HarfBuzz does very commonly. + # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it + # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once + # NOTE: Only add warnings here if you are sure they're spurious + msvc_args = [ + '/wd4018', # implicit signed/unsigned conversion + '/wd4146', # unary minus on unsigned (beware INT_MIN) + '/wd4244', # lossy type conversion (e.g. double -> int) + '/wd4305', # truncating type conversion (e.g. double -> float) + cpp.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8 + ] + add_project_arguments(msvc_args, language : 'c') + add_project_arguments(msvc_args, language : 'cpp') + # Disable SAFESEH with MSVC for libs that use external deps that are built with MinGW + # noseh_link_args = ['/SAFESEH:NO'] +endif + python3 = import('python').find_installation('python3') check_headers = [