aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/__init__.py4
-rw-r--r--mesonbuild/compilers/c.py10
-rw-r--r--mesonbuild/compilers/cpp.py6
3 files changed, 16 insertions, 4 deletions
diff --git a/mesonbuild/compilers/__init__.py b/mesonbuild/compilers/__init__.py
index 677301e..7050b0c 100644
--- a/mesonbuild/compilers/__init__.py
+++ b/mesonbuild/compilers/__init__.py
@@ -45,6 +45,8 @@ __all__ = [
'ClangCPPCompiler',
'ClangObjCCompiler',
'ClangObjCPPCompiler',
+ 'ClangClCCompiler',
+ 'ClangClCPPCompiler',
'CompilerArgs',
'CPPCompiler',
'DCompiler',
@@ -114,6 +116,7 @@ from .c import (
ArmCCompiler,
ArmclangCCompiler,
ClangCCompiler,
+ ClangClCCompiler,
GnuCCompiler,
ElbrusCCompiler,
IntelCCompiler,
@@ -124,6 +127,7 @@ from .cpp import (
ArmCPPCompiler,
ArmclangCPPCompiler,
ClangCPPCompiler,
+ ClangClCPPCompiler,
GnuCPPCompiler,
ElbrusCPPCompiler,
IntelCPPCompiler,
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 9b24e85..d17dd3a 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -170,7 +170,7 @@ class CCompiler(Compiler):
else:
# GNU ld and LLVM lld
return ['-Wl,--allow-shlib-undefined']
- elif self.id == 'msvc':
+ elif isinstance(self, VisualStudioCCompiler):
# link.exe
return ['/FORCE:UNRESOLVED']
# FIXME: implement other linkers
@@ -890,7 +890,7 @@ class CCompiler(Compiler):
stlibext = ['a']
# We've always allowed libname to be both `foo` and `libfoo`,
# and now people depend on it
- if strict and self.id != 'msvc': # lib prefix is not usually used with msvc
+ if strict and not isinstance(self, VisualStudioCCompiler): # lib prefix is not usually used with msvc
prefixes = ['lib']
else:
prefixes = ['lib', '']
@@ -900,7 +900,7 @@ class CCompiler(Compiler):
elif for_windows(env.is_cross_build(), env):
# FIXME: .lib files can be import or static so we should read the
# file, figure out which one it is, and reject the wrong kind.
- if self.id == 'msvc':
+ if isinstance(self, VisualStudioCCompiler):
shlibext = ['lib']
else:
shlibext = ['dll.a', 'lib', 'dll']
@@ -1546,6 +1546,10 @@ class VisualStudioCCompiler(CCompiler):
def get_argument_syntax(self):
return 'msvc'
+class ClangClCCompiler(VisualStudioCCompiler):
+ def __init__(self, exelist, version, is_cross, exe_wrap, is_64):
+ super().__init__(exelist, version, is_cross, exe_wrap, is_64)
+ self.id = 'clang-cl'
class ArmCCompiler(ArmCompiler, CCompiler):
def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs):
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 9dc2876..1045c7d 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -19,7 +19,7 @@ from .. import coredata
from .. import mlog
from ..mesonlib import MesonException, version_compare
-from .c import CCompiler, VisualStudioCCompiler
+from .c import CCompiler, VisualStudioCCompiler, ClangClCCompiler
from .compilers import (
CompilerType,
gnu_winlibs,
@@ -378,6 +378,10 @@ class VisualStudioCPPCompiler(VisualStudioCCompiler, CPPCompiler):
# so just use the plain C args.
return VisualStudioCCompiler.get_compiler_check_args(self)
+class ClangClCPPCompiler(VisualStudioCPPCompiler, ClangClCCompiler):
+ def __init__(self, exelist, version, is_cross, exe_wrap, is_64):
+ VisualStudioCPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap, is_64)
+ self.id = 'clang-cl'
class ArmCPPCompiler(ArmCompiler, CPPCompiler):
def __init__(self, exelist, version, compiler_type, is_cross, exe_wrap=None, **kwargs):