diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-05-23 18:56:50 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2022-05-23 19:07:05 +0800 |
commit | 10599993cc751a383feeacac61b4d1b2e3c50e79 (patch) | |
tree | cb51e9a9d04d9fca8bd35633fdbadc249724e538 /meson.build | |
parent | 5ba2da6db90d20c0b75349b7cfb65391b51c180f (diff) | |
download | sigc++-10599993cc751a383feeacac61b4d1b2e3c50e79.tar.gz |
Meson: Compensate for the lack of msvc_recommended_pragmas.h
libsigc++ does not depend on GLib, so msvc_recommended_pragmas.h may not be
available. If it isn't, disable warning C4244 to compensate for it.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meson.build b/meson.build index 376c9bd..ed21e13 100644 --- a/meson.build +++ b/meson.build @@ -188,7 +188,16 @@ add_project_arguments(warning_flags, language: 'cpp') # MSVC: Ignore warnings that aren't really harmful, but make those # that should not be overlooked stand out. if is_msvc - foreach wd : ['/FImsvc_recommended_pragmas.h', '/EHsc', '/wd4267', '/utf-8'] + # Turn off harmless warnings but make potentially dangerous ones glaring, + # distributed with GLib, if available + use_recommended_pragmas = cpp_compiler.get_supported_arguments('/FImsvc_recommended_pragmas.h') + if use_recommended_pragmas.length() > 0 + add_project_arguments(use_recommended_pragmas, language: 'cpp') + else + disabled_warning = cpp_compiler.get_supported_arguments(['/wd4244']) + add_project_arguments(disabled_warning, language: 'cpp') + endif + foreach wd : ['/EHsc', '/wd4267'] disabled_warning = cpp_compiler.get_supported_arguments(wd) add_project_arguments(disabled_warning, language: 'cpp') endforeach |