aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-12-12 13:43:33 -0800
committerXavier Claessens <xclaesse@gmail.com>2019-12-13 09:57:05 -0500
commit7f0224fb888cfe28d1e4ad913f33b8eb085eb83b (patch)
tree500172c05b0aec5b065c7fbe1f1b5313349c5242
parent614372aa556a08da2ffacce271dc7ba094ef58a9 (diff)
downloadmeson-7f0224fb888cfe28d1e4ad913f33b8eb085eb83b.zip
meson-7f0224fb888cfe28d1e4ad913f33b8eb085eb83b.tar.gz
meson-7f0224fb888cfe28d1e4ad913f33b8eb085eb83b.tar.bz2
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.
-rw-r--r--mesonbuild/compilers/c.py6
-rw-r--r--mesonbuild/compilers/cpp.py2
2 files changed, 2 insertions, 6 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index db7abf0..6a91b8e 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -326,8 +326,6 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM
"""Intel "ICL" compiler abstraction."""
- __have_warned = False
-
def __init__(self, exelist, version, for_machine: MachineChoice,
is_cross, info: 'MachineInfo', exe_wrap, target, **kwargs):
CCompiler.__init__(self, exelist, version, for_machine, is_cross,
@@ -346,9 +344,7 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM
args = []
std = options['c_std']
if std.value == 'c89':
- if not self.__have_warned:
- self.__have_warned = True
- mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.")
+ mlog.warning("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.", once=True)
elif std.value != 'none':
args.append('/Qstd:' + std.value)
return args
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 6d45a84..9e9e78e 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -484,7 +484,7 @@ class CPP11AsCPP14Mixin:
# if one is using anything before that point, one cannot set the standard.
if options['cpp_std'].value in {'vc++11', '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
# deepcopy since we're messing with members, and we can't simply
# copy the members because the option proxy doesn't support it.