aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/mixins/clike.py14
-rw-r--r--mesonbuild/compilers/mixins/pgi.py14
2 files changed, 20 insertions, 8 deletions
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 ad94271..0613e79 100644
--- a/mesonbuild/compilers/mixins/pgi.py
+++ b/mesonbuild/compilers/mixins/pgi.py
@@ -61,9 +61,21 @@ 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_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.
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]: