aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/environment.py9
-rw-r--r--mesonbuild/linkers.py5
2 files changed, 12 insertions, 2 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index dd1d4cf..5272a73 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -15,7 +15,7 @@
import os, platform, re, sys, shlex, shutil, subprocess, typing
from . import coredata
-from .linkers import ArLinker, ArmarLinker, VisualStudioLinker, DLinker, CcrxLinker
+from .linkers import ArLinker, ArmarLinker, VisualStudioLinker, DLinker, CcrxLinker, IntelVisualStudioLinker
from . import mesonlib
from .mesonlib import (
MesonException, EnvironmentException, MachineChoice, Popen_safe,
@@ -1172,11 +1172,14 @@ class Environment:
linkers = [self.vs_static_linker, self.clang_cl_static_linker, compiler.get_linker_exelist()]
else:
linkers = [self.default_static_linker, compiler.get_linker_exelist()]
+ elif isinstance(compiler, IntelClCCompiler):
+ # Intel has it's own linker that acts like microsoft's lib
+ linkers = ['xilib']
else:
linkers = [self.default_static_linker]
popen_exceptions = {}
for linker in linkers:
- if not set(['lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe']).isdisjoint(linker):
+ if not {'lib', 'lib.exe', 'llvm-lib', 'llvm-lib.exe', 'xilib', 'xilib.exe'}.isdisjoint(linker):
arg = '/?'
else:
arg = '--version'
@@ -1185,6 +1188,8 @@ class Environment:
except OSError as e:
popen_exceptions[' '.join(linker + [arg])] = e
continue
+ if "xilib: executing 'lib'" in err:
+ return IntelVisualStudioLinker(linker, getattr(compiler, 'machine', None))
if '/OUT:' in out.upper() or '/OUT:' in err.upper():
return VisualStudioLinker(linker, getattr(compiler, 'machine', None))
if p.returncode == 0 and ('armar' in linker or 'armar.exe' in linker):
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
index a24ec21..648d1ef 100644
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -82,6 +82,11 @@ class VisualStudioLinker(VisualStudioLikeLinker, StaticLinker):
"""Microsoft's lib static linker."""
+class IntelVisualStudioLinker(VisualStudioLikeLinker, StaticLinker):
+
+ """Intel's xilib static linker."""
+
+
class ArLinker(StaticLinker):
def __init__(self, exelist):