From b5b48f33bc37f0d83bf92f9af74311c8c030cb7f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 15 Jul 2019 16:01:10 -0700 Subject: linkers: Add a PosixDynamicLinkerMixin This is a mixin class for DynamicLinkers that aims to provide only the most basic posix-like linker arguments, in other words bits that gnu ld, apple's ld, solaris's ld, and other completely disjoint linkers that are used on Unix-like OSes share. --- mesonbuild/linkers.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index e758448..c813e3e 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -349,3 +349,22 @@ class DynamicLinker(metaclass=abc.ABCMeta): rpath_paths: str, build_rpath: str, install_rpath: str) -> typing.List[str]: return [] + + +class PosixDynamicLinkerMixin: + + """Mixin class for POSIX-ish linkers. + + This is obviously a pretty small subset of the linker interface, but + enough dynamic linkers that meson supports are POSIX-like but not + GNU-like that it makes sense to split this out. + """ + + def get_output_args(self, outname: str) -> typing.List[str]: + return ['-o', outname] + + def get_std_shared_lib_args(self) -> typing.List[str]: + return ['-shared'] + + def get_search_args(self, dirname: str) -> typing.List[str]: + return ['-L', dirname] -- cgit v1.1