linkers: Add linker class for intel's xilib

pull/5331/head
Dylan Baker 6 years ago
parent af19db7b40
commit 7d0e0d6f6e
  1. 9
      mesonbuild/environment.py
  2. 5
      mesonbuild/linkers.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):

@ -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):

Loading…
Cancel
Save