From 93c3ec7e2dd6d425baff5fd80e5a46c88d152cb0 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 11 Jun 2020 12:44:53 -0700 Subject: compilers: Return CompilerArgs from compiler instance Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method. --- mesonbuild/linkers.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mesonbuild/linkers.py') diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index bb3229d..805bbc7 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -17,6 +17,7 @@ import os import typing as T from . import mesonlib +from .arglist import CompilerArgs from .envconfig import get_env_var if T.TYPE_CHECKING: @@ -29,6 +30,9 @@ class StaticLinker: def __init__(self, exelist: T.List[str]): self.exelist = exelist + def compiler_args(self, args: T.Optional[T.Iterable[str]] = None) -> CompilerArgs: + return CompilerArgs(self, args) + def can_linker_accept_rsp(self) -> bool: """ Determines whether the linker can accept arguments using the @rsp syntax. -- cgit v1.1