diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-07-15 16:01:10 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-08-14 13:13:23 -0700 |
commit | b5b48f33bc37f0d83bf92f9af74311c8c030cb7f (patch) | |
tree | 4e823d0ee0a7d7a1259af1818c2fd0181b80adbf | |
parent | 6770af4d36a5d033f690aa1dbdb3e851b108f862 (diff) | |
download | meson-b5b48f33bc37f0d83bf92f9af74311c8c030cb7f.zip meson-b5b48f33bc37f0d83bf92f9af74311c8c030cb7f.tar.gz meson-b5b48f33bc37f0d83bf92f9af74311c8c030cb7f.tar.bz2 |
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.
-rw-r--r-- | mesonbuild/linkers.py | 19 |
1 files changed, 19 insertions, 0 deletions
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] |