Visual Studio: Only use /utf-8 on VS2015 or later or clang-cl

The compiler flag only exists on Visual Studio 2015 or later, or clang-cl,
and using this always can interfere with compiler feature detection when
this flag is not supported.

So, remove '/utf-8' from always_args if we are on Visual Studio 2013 or
earlier.
pull/10314/head
Chun-wei Fan 3 years ago committed by Jussi Pakkanen
parent 660bfa6e7c
commit 8ed151bbd7
  1. 4
      mesonbuild/compilers/mixins/visualstudio.py

@ -130,6 +130,10 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):
self.machine = target
if mesonlib.version_compare(self.version, '>=19.28.29910'): # VS 16.9.0 includes cl 19.28.29910
self.base_options.add(mesonlib.OptionKey('b_sanitize'))
# Exclude /utf-8 in self.always_args in VS2013 and earlier
if not isinstance(self, ClangClCompiler):
if mesonlib.version_compare(self.version, '<19.00'):
self.always_args.remove('/utf-8')
assert self.linker is not None
self.linker.machine = self.machine

Loading…
Cancel
Save