aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-07-15 16:01:10 -0700
committerDylan Baker <dylan@pnwbakers.com>2019-08-14 13:13:23 -0700
commitb5b48f33bc37f0d83bf92f9af74311c8c030cb7f (patch)
tree4e823d0ee0a7d7a1259af1818c2fd0181b80adbf
parent6770af4d36a5d033f690aa1dbdb3e851b108f862 (diff)
downloadmeson-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.py19
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]