Skip to content

Commit

Permalink
Visual Studio: Only use /utf-8 on VS2015 or later or clang-cl
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fanc999-1 authored and jpakkane committed Apr 25, 2022
1 parent 660bfa6 commit 8ed151b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mesonbuild/compilers/mixins/visualstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ def __init__(self, target: str):
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

Expand Down

0 comments on commit 8ed151b

Please sign in to comment.