diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 6688c6201..c64fe59c8 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -15,7 +15,7 @@ import configparser, os, platform, re, shlex, shutil, subprocess from . import coredata -from .linkers import ArLinker, VisualStudioLinker +from .linkers import ArLinker, ArmarLinker, VisualStudioLinker from . import mesonlib from .mesonlib import EnvironmentException, Popen_safe from . import mlog @@ -885,6 +885,8 @@ This is probably wrong, it should always point to the native compiler.''' % evar continue if '/OUT:' in out or '/OUT:' in err: return VisualStudioLinker(linker) + if p.returncode == 0 and ('armar' in linker or 'armar.exe' in linker): + return ArmarLinker(linker) if p.returncode == 0: return ArLinker(linker) if p.returncode == 1 and err.startswith('usage'): # OSX diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index 7e89de59b..6e40ab438 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -83,9 +83,6 @@ class ArLinker(StaticLinker): self.std_args = ['csrD'] else: self.std_args = ['csr'] - # For 'armar' the options should be prefixed with '-'. - if 'armar' in stdo: - self.std_args = ['-csr'] def can_linker_accept_rsp(self): return mesonlib.is_windows() @@ -129,3 +126,14 @@ class ArLinker(StaticLinker): def get_link_debugfile_args(self, targetfile): return [] + +class ArmarLinker(ArLinker): + + def __init__(self, exelist): + self.exelist = exelist + self.id = 'armar' + self.std_args = ['-csr'] + + def can_linker_accept_rsp(self): + # armar cann't accept arguments using the @rsp syntax + return False