compilers: make use of mlog.log_once

I'm sure there are other places that could use this, but I didn't see
any right off that bat.
pull/4325/head
Dylan Baker 5 years ago committed by Xavier Claessens
parent 614372aa55
commit 7f0224fb88
  1. 6
      mesonbuild/compilers/c.py
  2. 2
      mesonbuild/compilers/cpp.py

@ -326,8 +326,6 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM
"""Intel "ICL" compiler abstraction.""" """Intel "ICL" compiler abstraction."""
__have_warned = False
def __init__(self, exelist, version, for_machine: MachineChoice, def __init__(self, exelist, version, for_machine: MachineChoice,
is_cross, info: 'MachineInfo', exe_wrap, target, **kwargs): is_cross, info: 'MachineInfo', exe_wrap, target, **kwargs):
CCompiler.__init__(self, exelist, version, for_machine, is_cross, CCompiler.__init__(self, exelist, version, for_machine, is_cross,
@ -346,9 +344,7 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM
args = [] args = []
std = options['c_std'] std = options['c_std']
if std.value == 'c89': if std.value == 'c89':
if not self.__have_warned: mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.", once=True)
self.__have_warned = True
mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.")
elif std.value != 'none': elif std.value != 'none':
args.append('/Qstd:' + std.value) args.append('/Qstd:' + std.value)
return args return args

@ -484,7 +484,7 @@ class CPP11AsCPP14Mixin:
# if one is using anything before that point, one cannot set the standard. # if one is using anything before that point, one cannot set the standard.
if options['cpp_std'].value in {'vc++11', 'c++11'}: if options['cpp_std'].value in {'vc++11', 'c++11'}:
mlog.warning(self.id, 'does not support C++11;', mlog.warning(self.id, 'does not support C++11;',
'attempting best effort; setting the standard to C++14') 'attempting best effort; setting the standard to C++14', once=True)
# Don't mutate anything we're going to change, we need to use # Don't mutate anything we're going to change, we need to use
# deepcopy since we're messing with members, and we can't simply # deepcopy since we're messing with members, and we can't simply
# copy the members because the option proxy doesn't support it. # copy the members because the option proxy doesn't support it.

Loading…
Cancel
Save