summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/c.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-01-06 13:49:01 -0800
committerDylan Baker <dylan@pnwbakers.com>2020-01-28 10:52:00 -0800
commit0f47ca95c1291ed954bf6a84783208d5538ef881 (patch)
tree2214c06a5e8156e597dbfea0a47ed647ff32c079 /mesonbuild/compilers/c.py
parent3d60665885132cceccc7d80640a5b4735d6a7d48 (diff)
downloadmeson-0f47ca95c1291ed954bf6a84783208d5538ef881.tar.gz
compilers: Split ClangCL and MSVC mixins
Instead of checking the compiler id inside the VisualStudioLikeCompiler class, this creates two subclasses that each represent the divergent behavior of the two compilers
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r--mesonbuild/compilers/c.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 464756250..a01b1f913 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -21,7 +21,7 @@ from .c_function_attributes import C_FUNC_ATTRIBUTES
from .mixins.clike import CLikeCompiler
from .mixins.ccrx import CcrxCompiler
from .mixins.arm import ArmCompiler, ArmclangCompiler
-from .mixins.visualstudio import VisualStudioLikeCompiler
+from .mixins.visualstudio import MSVCCompiler, ClangClCompiler
from .mixins.gnu import GnuCompiler
from .mixins.intel import IntelGnuLikeCompiler, IntelVisualStudioLikeCompiler
from .mixins.clang import ClangCompiler
@@ -304,24 +304,22 @@ class VisualStudioLikeCCompilerMixin:
return options['c_winlibs'].value[:]
-class VisualStudioCCompiler(VisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
+class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
def __init__(self, exelist, version, for_machine: MachineChoice,
is_cross, info: 'MachineInfo', exe_wrap, target: str,
**kwargs):
CCompiler.__init__(self, exelist, version, for_machine, is_cross,
info, exe_wrap, **kwargs)
- VisualStudioLikeCompiler.__init__(self, target)
- self.id = 'msvc'
+ MSVCCompiler.__init__(self, target)
-class ClangClCCompiler(VisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
+class ClangClCCompiler(ClangClCompiler, VisualStudioLikeCCompilerMixin, CCompiler):
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,
info, exe_wrap, **kwargs)
- VisualStudioLikeCompiler.__init__(self, target)
- self.id = 'clang-cl'
+ ClangClCompiler.__init__(self, target)
class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerMixin, CCompiler):