summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2018-10-09 11:04:27 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-11-15 18:42:25 -0800
commit28fd725d61bec363d9bcc403e78b38312dfeb276 (patch)
tree9d0597bf4e553d3d67298522b6ed82bdd2e97458
parent21a7528b2fe3176445d918e921fe374acafb6de2 (diff)
downloadmeson-28fd725d61bec363d9bcc403e78b38312dfeb276.tar.gz
compilers: fix compiler.compile for Intel Compilers
has_arguments is the wrong thing to fix, since all checks that require compiler options are based on compiles, it's the right thing to modify.
-rw-r--r--mesonbuild/compilers/c.py8
-rw-r--r--mesonbuild/compilers/compilers.py19
2 files changed, 19 insertions, 8 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 1b198b645..240d424bf 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -410,12 +410,12 @@ class CCompiler(Compiler):
dependencies=dependencies)
def _get_compiler_check_args(self, env, extra_args, dependencies, mode='compile'):
- if callable(extra_args):
- extra_args = extra_args(mode)
if extra_args is None:
extra_args = []
- elif isinstance(extra_args, str):
- extra_args = [extra_args]
+ else:
+ extra_args = listify(extra_args)
+ extra_args = listify([e(mode) if callable(e) else e for e in extra_args])
+
if dependencies is None:
dependencies = []
elif not isinstance(dependencies, list):
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index ca8c09ca9..306e5d69b 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -19,7 +19,10 @@ from ..linkers import StaticLinker
from .. import coredata
from .. import mlog
from .. import mesonlib
-from ..mesonlib import EnvironmentException, MesonException, OrderedSet, version_compare, Popen_safe
+from ..mesonlib import (
+ EnvironmentException, MesonException, OrderedSet, version_compare,
+ Popen_safe
+)
"""This file contains the data files of all compilers Meson knows
about. To support a new compiler, add its information below.
@@ -1733,6 +1736,7 @@ class ArmclangCompiler:
# Tested on linux for ICC 14.0.3, 15.0.6, 16.0.4, 17.0.1, 19.0.0
class IntelCompiler(GnuLikeCompiler):
+
def __init__(self, compiler_type):
super().__init__(compiler_type)
# As of 19.0.0 ICC doesn't have sanitizer, color, or lto support.
@@ -1764,9 +1768,16 @@ class IntelCompiler(GnuLikeCompiler):
else:
return ['-openmp']
- def has_arguments(self, args, env, code, mode):
- # -diag-error 10148 is required to catch invalid -W options
- return super().has_arguments(args + ['-diag-error', '10006', '-diag-error', '10148'], env, code, mode)
+ def compiles(self, *args, **kwargs):
+ # This covers a case that .get('foo', []) doesn't, that extra_args is
+ # defined and is None
+ extra_args = kwargs.get('extra_args') or []
+ kwargs['extra_args'] = [
+ extra_args,
+ '-diag-error', '10006', # ignoring unknown option
+ '-diag-error', '10148', # Option not supported
+ ]
+ return super().compiles(*args, **kwargs)
class ArmCompiler: