summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2022-05-23 16:52:41 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2022-05-23 17:12:31 +0800
commit3612a16e3a4d148a41d209cb5c9a7249be97a73c (patch)
treec533dfda1fb60ef9a788d1849374b4be25a1992f
parent31516758214a50833301cd96c2c805986e630dd6 (diff)
Meson/MSVC: Compensate for the lack of msvc_recommended_pragmas.h
Since cairomm does not hard-depend on GLib, it may be the case that msvc_recommended_pragmas.h is not available during the build. If it is not, disable warnings C4244 and C4101, which are part of the warnings that it disables.
-rw-r--r--meson.build9
1 files changed, 8 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index b55921a..e7eb27d 100644
--- a/meson.build
+++ b/meson.build
@@ -234,7 +234,14 @@ msvc14x_toolset_ver = ''
# 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', '/wd4267', '/wd4800', '/utf-8']
+ 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', '/wd4101'])
+ add_project_arguments(disabled_warning, language: 'cpp')
+ endif
+ foreach wd : ['/wd4267', '/wd4800', '/utf-8']
disabled_warning = cpp_compiler.get_supported_arguments(wd)
add_project_arguments(disabled_warning, language: 'cpp')
endforeach