aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-06-11 12:44:53 -0700
committerDylan Baker <dylan@pnwbakers.com>2020-06-22 12:06:10 -0700
commit93c3ec7e2dd6d425baff5fd80e5a46c88d152cb0 (patch)
treed5913f089b2a69de191e5c67b1e8dc8010742b6d /mesonbuild/linkers.py
parent9d0ad66c29fccd2ff72c2b40da02cdb2b03ccba6 (diff)
downloadmeson-93c3ec7e2dd6d425baff5fd80e5a46c88d152cb0.zip
meson-93c3ec7e2dd6d425baff5fd80e5a46c88d152cb0.tar.gz
meson-93c3ec7e2dd6d425baff5fd80e5a46c88d152cb0.tar.bz2
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.
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r--mesonbuild/linkers.py4
1 files changed, 4 insertions, 0 deletions
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.