Skip to content

Commit 1059999

Browse files
committed
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.
1 parent 5ba2da6 commit 1059999

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

meson.build

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,16 @@ add_project_arguments(warning_flags, language: 'cpp')
188188
# MSVC: Ignore warnings that aren't really harmful, but make those
189189
# that should not be overlooked stand out.
190190
if is_msvc
191-
foreach wd : ['/FImsvc_recommended_pragmas.h', '/EHsc', '/wd4267', '/utf-8']
191+
# Turn off harmless warnings but make potentially dangerous ones glaring,
192+
# distributed with GLib, if available
193+
use_recommended_pragmas = cpp_compiler.get_supported_arguments('/FImsvc_recommended_pragmas.h')
194+
if use_recommended_pragmas.length() > 0
195+
add_project_arguments(use_recommended_pragmas, language: 'cpp')
196+
else
197+
disabled_warning = cpp_compiler.get_supported_arguments(['/wd4244'])
198+
add_project_arguments(disabled_warning, language: 'cpp')
199+
endif
200+
foreach wd : ['/EHsc', '/wd4267']
192201
disabled_warning = cpp_compiler.get_supported_arguments(wd)
193202
add_project_arguments(disabled_warning, language: 'cpp')
194203
endforeach

0 commit comments

Comments
 (0)