From 1e08d81476ff1edb1316b5491c445aaed941e5f3 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Sun, 28 Jul 2019 20:54:21 -0400 Subject: PGI -shared is for Linux only --- mesonbuild/compilers/mixins/pgi.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mesonbuild/compilers/mixins') diff --git a/mesonbuild/compilers/mixins/pgi.py b/mesonbuild/compilers/mixins/pgi.py index ad94271..3b0451a 100644 --- a/mesonbuild/compilers/mixins/pgi.py +++ b/mesonbuild/compilers/mixins/pgi.py @@ -61,9 +61,16 @@ class PGICompiler(): def get_no_warn_args(self) -> typing.List[str]: return ['-silent'] + def get_std_shared_lib_link_args(self) -> typing.List[str]: + # PGI -shared is Linux only. + if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler: + return [] + return ['-shared'] + def get_pic_args(self) -> typing.List[str]: + # PGI -fPIC is Linux only. if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler: - return [] # PGI -fPIC is Linux only. + return [] return ['-fPIC'] def openmp_flags(self) -> typing.List[str]: -- cgit v1.1 From 7eebb6749a6c059ec9f1f2752a3518e44e9612c9 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Sun, 28 Jul 2019 21:07:03 -0400 Subject: no special shared lib args for PGI --- mesonbuild/compilers/mixins/clike.py | 14 +++++++------- mesonbuild/compilers/mixins/pgi.py | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'mesonbuild/compilers/mixins') diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 0591b7f..37d2424 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -209,25 +209,25 @@ class CLikeCompiler: ''' return self.get_compiler_dirs(env, 'programs') - def get_pic_args(self): + def get_pic_args(self) -> typing.List[str]: return ['-fPIC'] - def name_string(self): + def name_string(self) -> str: return ' '.join(self.exelist) - def get_pch_use_args(self, pch_dir, header): + def get_pch_use_args(self, pch_dir: str, header: str) -> typing.List[str]: return ['-include', os.path.basename(header)] - def get_pch_name(self, header_name): + def get_pch_name(self, header_name: str) -> str: return os.path.basename(header_name) + '.' + self.get_pch_suffix() - def get_linker_search_args(self, dirname): + def get_linker_search_args(self, dirname: str) -> typing.List[str]: return ['-L' + dirname] def get_default_include_dirs(self): return [] - def gen_export_dynamic_link_args(self, env): + def gen_export_dynamic_link_args(self, env) -> typing.List[str]: m = env.machines[self.for_machine] if m.is_windows() or m.is_cygwin(): return ['-Wl,--export-all-symbols'] @@ -236,7 +236,7 @@ class CLikeCompiler: else: return ['-Wl,-export-dynamic'] - def gen_import_library_args(self, implibname): + def gen_import_library_args(self, implibname: str) -> typing.List[str]: """ The name of the outputted import library diff --git a/mesonbuild/compilers/mixins/pgi.py b/mesonbuild/compilers/mixins/pgi.py index 3b0451a..6cb8b45 100644 --- a/mesonbuild/compilers/mixins/pgi.py +++ b/mesonbuild/compilers/mixins/pgi.py @@ -61,6 +61,9 @@ class PGICompiler(): def get_no_warn_args(self) -> typing.List[str]: return ['-silent'] + def gen_import_library_args(self, implibname: str) -> typing.List[str]: + return [] + def get_std_shared_lib_link_args(self) -> typing.List[str]: # PGI -shared is Linux only. if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler: -- cgit v1.1 From d0e78a2534a43a3523e33d516e834a60af3a21ba Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Sun, 28 Jul 2019 21:57:38 -0400 Subject: default libtype to static to allow windows compilers to not skip To make Fortran tests useful on Windows, the library_type should default to static, unless needed to specifically test shared. Shared Fortran libs on Windows for non-Gfortran compilers is fragile requiring proprietary code syntax. --- mesonbuild/compilers/mixins/pgi.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mesonbuild/compilers/mixins') diff --git a/mesonbuild/compilers/mixins/pgi.py b/mesonbuild/compilers/mixins/pgi.py index 6cb8b45..0613e79 100644 --- a/mesonbuild/compilers/mixins/pgi.py +++ b/mesonbuild/compilers/mixins/pgi.py @@ -66,9 +66,11 @@ class PGICompiler(): def get_std_shared_lib_link_args(self) -> typing.List[str]: # PGI -shared is Linux only. - if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler: - return [] - return ['-shared'] + if self.compiler_type.is_windows_compiler: + return ['-Bdynamic', '-Mmakedll'] + elif not self.compiler_type.is_osx_compiler: + return ['-shared'] + return [] def get_pic_args(self) -> typing.List[str]: # PGI -fPIC is Linux only. -- cgit v1.1