Skip to content

Commit 063a96f

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 fb8038c commit 063a96f

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
@@ -184,7 +184,16 @@ add_project_arguments(warning_flags, language: 'cpp')
184184
# MSVC: Ignore warnings that aren't really harmful, but make those
185185
# that should not be overlooked stand out.
186186
if is_msvc
187-
foreach wd : ['/FImsvc_recommended_pragmas.h', '/EHsc', '/wd4267']
187+
# Turn off harmless warnings but make potentially dangerous ones glaring,
188+
# distributed with GLib, if available
189+
use_recommended_pragmas = cpp_compiler.get_supported_arguments('/FImsvc_recommended_pragmas.h')
190+
if use_recommended_pragmas.length() > 0
191+
add_project_arguments(use_recommended_pragmas, language: 'cpp')
192+
else
193+
disabled_warning = cpp_compiler.get_supported_arguments(['/wd4244'])
194+
add_project_arguments(disabled_warning, language: 'cpp')
195+
endif
196+
foreach wd : ['/EHsc', '/wd4267']
188197
disabled_warning = cpp_compiler.get_supported_arguments(wd)
189198
add_project_arguments(disabled_warning, language: 'cpp')
190199
endforeach

0 commit comments

Comments
 (0)