aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 7b4f3c9..31f12b1 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -46,6 +46,7 @@ known_shlib_kwargs = known_basic_kwargs.copy()
known_shlib_kwargs.update({'version' : True,
'soversion' : True,
'name_prefix' : True,
+ 'name_suffix' : True,
})
backslash_explanation = \
@@ -415,9 +416,20 @@ class BuildTarget():
self.resources = resources
if 'name_prefix' in kwargs:
name_prefix = kwargs['name_prefix']
- if not isinstance(name_prefix, str):
+ if isinstance(name_prefix, list):
+ if len(name_prefix) != 0:
+ raise InvalidArguments('Array must be empty to signify null.')
+ elif not isinstance(name_prefix, str):
raise InvalidArguments('Name prefix must be a string.')
self.prefix = name_prefix
+ if 'name_suffix' in kwargs:
+ name_suffix = kwargs['name_suffix']
+ if isinstance(name_suffix, list):
+ if len(name_suffix) != 0:
+ raise InvalidArguments('Array must be empty to signify null.')
+ elif not isinstance(name_suffix, str):
+ raise InvalidArguments('Name suffix must be a string.')
+ self.suffix = name_suffix
def get_subdir(self):
return self.subdir
@@ -684,14 +696,17 @@ class SharedLibrary(BuildTarget):
super().__init__(name, subdir, subproject, is_cross, sources, objects, environment, kwargs);
if len(self.sources) > 0 and self.sources[0].endswith('.cs'):
prefix = 'lib'
- self.suffix = 'dll'
+ suffix = 'dll'
else:
prefix = environment.get_shared_lib_prefix()
- self.suffix = environment.get_shared_lib_suffix()
+ suffix = environment.get_shared_lib_suffix()
if not hasattr(self, 'prefix'):
self.prefix = prefix
- if len(self.sources) > 0 and self.sources[0].endswith('.rs'):
- self.suffix = 'rlib'
+ if not hasattr(self, 'suffix'):
+ if len(self.sources) > 0 and self.sources[0].endswith('.rs'):
+ self.suffix = 'rlib'
+ else:
+ self.suffix = suffix
self.importsuffix = environment.get_import_lib_suffix()
self.filename = self.prefix + self.name + '.' + self.suffix