diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-05-23 15:35:29 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-05-23 15:57:34 +0800 |
commit | 59592487a21d3d2aee89376bb90c3ea4388052a4 (patch) | |
tree | 390bafb830d925d5fcfa0bccc27c01e3a82b3765 | |
parent | 13fbe29e7eea943fb576e5b9c91f57f9d6089cee (diff) | |
download | glibmm-59592487a21d3d2aee89376bb90c3ea4388052a4.tar.gz |
Meson: Re-organize MSVC compiler warnings-related items
Add a short description of each of the current compiler flags we are using for
this purpose, and only apply '/wd4267' for 64-bit builds since that flag
normally applies for 64-bit builds only.
-rw-r--r-- | meson.build | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/meson.build b/meson.build index 3ffc451a..cf632f0c 100644 --- a/meson.build +++ b/meson.build @@ -233,10 +233,20 @@ msvc14x_toolset_ver = '' # MSVC: Ignore warnings that aren't really harmful, but make those # that should not be overlooked stand out. if is_msvc - disabled_warnings = cpp_compiler.get_supported_arguments([ - '/FImsvc_recommended_pragmas.h', '/wd4267', '/EHsc', '/utf-8' - ]) - add_project_arguments(disabled_warnings, language: 'cpp') + disable_warnings_list = [ + '/FImsvc_recommended_pragmas.h', # Turn off harmless warnings but make potentially + # dangerous ones glaring, distributed with GLib + '/EHsc', # avoid warnings caused by exception handling model used + '/utf-8', # Avoid C4819 unicode conversion warnings when building on CJK locales + ] + if host_machine.cpu_family() == 'x86_64' or host_machine.cpu_family() == 'aarch64' + # 'var' : conversion from 'size_t' to 'type', possible loss of data (applies on 64-bit builds) + disable_warnings_list += '/wd4267' + endif + add_project_arguments( + cpp_compiler.get_supported_arguments(disable_warnings_list), + language: 'cpp', + ) if use_msvc14x_toolset_ver if cpp_compiler.version().version_compare('>=19.30') |