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 16:55:20 +0800
commite520469e63c14b1e6016aae747546d17ea9b49de (patch)
tree053b368bc79b3205c5e0385ba01b1f7d9c4824ca
parent670ccb6ef406dbf72a7a0a9bfd5cc478606ad654 (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 193978a..5b87e35 100644
--- a/meson.build
+++ b/meson.build
@@ -241,7 +241,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