From 7c5b25ce51f2414f90fba887c1cb09544b4bfca5 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Mon, 22 Jul 2019 13:22:40 -0700 Subject: linkers: Add PGIDynamicLinker --- mesonbuild/linkers.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'mesonbuild/linkers.py') diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index 52c65c6..022b9a3 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -707,3 +707,31 @@ class ArmClangDynamicLinker(ArmDynamicLinker): def import_library_args(self, implibname: str) -> typing.List[str]: return ['--symdefs=' + implibname] + + +class PGIDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): + + """PGI linker.""" + + def get_allow_undefined_args(self) -> typing.List[str]: + return [] + + def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str, + suffix: str, soversion: str, darwin_versions: typing.Tuple[str, str], + is_shared_module: bool) -> typing.List[str]: + return [] + + def get_std_shared_lib_args(self) -> typing.List[str]: + # PGI -shared is Linux only. + if mesonlib.is_windows(): + return ['-Bdynamic', '-Mmakedll'] + elif mesonlib.is_linux: + return ['-shared'] + return [] + + def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str, + rpath_paths: str, build_rpath: str, + install_rpath: str) -> typing.List[str]: + if env.machines[self.for_machine].is_windows(): + return ['-R' + os.path.join(build_dir, p) for p in rpath_paths] + return [] -- cgit v1.1