Skip to content

Commit

Permalink
Revert /utf-8 changes in the visualstudio mixin to the 0.62.0 state
Browse files Browse the repository at this point in the history
Specifically, this is a combination of the following:

- Revert "visualstudio.py: Apply /utf-8 only on clang or VS2015+"

  This reverts commit 6e7c3ef.

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

  This reverts commit 8ed151b.

The changes were broken and untested, although this is because of a lack
of general CI testing for all languages on Windows. At least, this broke
the use of ifort, and possibly more.

The changes are fundamentally a bit "exciting", as they step out of the
hierarchy of compiler definitions and apply arguments almost willy-nilly.

And apparently it's leaky all over the place. I don't understand all of
what is going on with it, but it plainly failed to achieve its desired
goal and needs to be rolled back ASAP.
  • Loading branch information
eli-schwartz authored and nirbheek committed Aug 8, 2022
1 parent 79db787 commit ff6e6e1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mesonbuild/compilers/mixins/visualstudio.py
Expand Up @@ -101,7 +101,9 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta):

# /showIncludes is needed for build dependency tracking in Ninja
# See: https://ninja-build.org/manual.html#_deps
always_args = ['/nologo', '/showIncludes'] # type: T.List[str]
# Assume UTF-8 sources by default, but self.unix_args_to_native() removes it
# if `/source-charset` is set too.
always_args = ['/nologo', '/showIncludes', '/utf-8']
warn_args = {
'0': [],
'1': ['/W2'],
Expand All @@ -115,10 +117,6 @@ def __init__(self, target: str):
self.base_options = {mesonlib.OptionKey(o) for o in ['b_pch', 'b_ndebug', 'b_vscrt']} # FIXME add lto, pgo and the like
self.target = target
self.is_64 = ('x64' in target) or ('x86_64' in target)
# Assume UTF-8 sources by default on Visual Studio 2015 or later, or clang,
# but self.unix_args_to_native() removes it if `/source-charset` is set too.
if isinstance(self, ClangClCompiler) or mesonlib.version_compare(self.version, '>=19.00'):
self.always_args = self.always_args + ['/utf-8']
# do some canonicalization of target machine
if 'x86_64' in target:
self.machine = 'x64'
Expand Down

0 comments on commit ff6e6e1

Please sign in to comment.