compilers: rename IntelCompiler to IntelGnuLikeCompiler

The Intel compiler is strange. On Linux and macOS it's called ICC, and
it tries to mostly behave like gcc/clang. On Windows it's called ICL,
and tries to behave like MSVC. This makes the code that's used to
implement ICC support useless for supporting ICL, because their command
line interfaces are completely different.
pull/5331/head
Dylan Baker 6 years ago
parent 5fb64b0cfa
commit 080f59cf43
  1. 4
      mesonbuild/compilers/__init__.py
  2. 6
      mesonbuild/compilers/c.py
  3. 2
      mesonbuild/compilers/compilers.py
  4. 6
      mesonbuild/compilers/cpp.py
  5. 8
      mesonbuild/compilers/fortran.py
  6. 2
      run_unittests.py

@ -65,7 +65,7 @@ __all__ = [
'FlangFortranCompiler',
'GnuObjCCompiler',
'GnuObjCPPCompiler',
'IntelCompiler',
'IntelGnuLikeCompiler',
'IntelCCompiler',
'IntelCPPCompiler',
'IntelFortranCompiler',
@ -119,7 +119,7 @@ from .compilers import (
ClangCompiler,
CompilerArgs,
GnuCompiler,
IntelCompiler,
IntelGnuLikeCompiler,
CcrxCompiler,
VisualStudioLikeCompiler,
)

@ -30,7 +30,7 @@ from .compilers import (
CompilerType,
GnuCompiler,
ElbrusCompiler,
IntelCompiler,
IntelGnuLikeCompiler,
PGICompiler,
CcrxCompiler,
VisualStudioLikeCompiler,
@ -221,10 +221,10 @@ class ElbrusCCompiler(GnuCCompiler, ElbrusCompiler):
dependencies=dependencies)
class IntelCCompiler(IntelCompiler, CCompiler):
class IntelCCompiler(IntelGnuLikeCompiler, CCompiler):
def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
CCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwargs)
IntelCompiler.__init__(self, compiler_type)
IntelGnuLikeCompiler.__init__(self, compiler_type)
self.lang_header = 'c-header'
default_warn_args = ['-Wall', '-w3', '-diag-disable:remark']
self.warn_args = {'0': [],

@ -2288,7 +2288,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):
class IntelGnuLikeCompiler(GnuLikeCompiler):
def __init__(self, compiler_type):
super().__init__(compiler_type)

@ -27,7 +27,7 @@ from .compilers import (
ClangCompiler,
GnuCompiler,
ElbrusCompiler,
IntelCompiler,
IntelGnuLikeCompiler,
PGICompiler,
ArmCompiler,
ArmclangCompiler,
@ -301,10 +301,10 @@ class ElbrusCPPCompiler(GnuCPPCompiler, ElbrusCompiler):
dependencies=dependencies)
class IntelCPPCompiler(IntelCompiler, CPPCompiler):
class IntelCPPCompiler(IntelGnuLikeCompiler, CPPCompiler):
def __init__(self, exelist, version, compiler_type, is_cross, exe_wrap, **kwargs):
CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, **kwargs)
IntelCompiler.__init__(self, compiler_type)
IntelGnuLikeCompiler.__init__(self, compiler_type)
self.lang_header = 'c++-header'
default_warn_args = ['-Wall', '-w3', '-diag-disable:remark',
'-Wpch-messages', '-Wnon-virtual-dtor']

@ -26,8 +26,8 @@ from .compilers import (
GnuCompiler,
ClangCompiler,
ElbrusCompiler,
IntelCompiler,
PGICompiler,
IntelGnuLikeCompiler,
PGICompiler
)
from .clike import CLikeCompiler
@ -213,13 +213,13 @@ class SunFortranCompiler(FortranCompiler):
return ['-xopenmp']
class IntelFortranCompiler(IntelCompiler, FortranCompiler):
class IntelFortranCompiler(IntelGnuLikeCompiler, FortranCompiler):
def __init__(self, exelist, version, is_cross, exe_wrapper=None, **kwags):
self.file_suffixes = ('f90', 'f', 'for', 'ftn', 'fpp')
FortranCompiler.__init__(self, exelist, version, is_cross, exe_wrapper, **kwags)
# FIXME: Add support for OS X and Windows in detect_fortran_compiler so
# we are sent the type of compiler
IntelCompiler.__init__(self, CompilerType.ICC_STANDARD)
IntelGnuLikeCompiler.__init__(self, CompilerType.ICC_STANDARD)
self.id = 'intel'
default_warn_args = ['-warn', 'general', '-warn', 'truncated_source']
self.warn_args = {'0': [],

@ -1939,7 +1939,7 @@ class AllPlatformTests(BasePlatformTests):
'''
gnu = mesonbuild.compilers.GnuCompiler
clang = mesonbuild.compilers.ClangCompiler
intel = mesonbuild.compilers.IntelCompiler
intel = mesonbuild.compilers.IntelGnuLikeCompiler
msvc = (mesonbuild.compilers.VisualStudioCCompiler, mesonbuild.compilers.VisualStudioCPPCompiler)
clangcl = (mesonbuild.compilers.ClangClCCompiler, mesonbuild.compilers.ClangClCPPCompiler)
ar = mesonbuild.linkers.ArLinker

Loading…
Cancel
Save