diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2020-04-11 16:44:04 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2020-04-11 19:57:38 +0100 |
commit | 27d498de6dc260286efa1f979e4f7e37ff93a8ad (patch) | |
tree | ca0e25c9690036bebe85f0036bf3495bd1551f31 | |
parent | 40256fb7e6d6eeb85295534177bb4aa249670e3f (diff) | |
download | meson-27d498de6dc260286efa1f979e4f7e37ff93a8ad.zip meson-27d498de6dc260286efa1f979e4f7e37ff93a8ad.tar.gz meson-27d498de6dc260286efa1f979e4f7e37ff93a8ad.tar.bz2 |
Fix handling of library(name_prefix: [])
Adjust the handling of a name_prefix: [] kwarg to be the same as
name_suffix: [] kwarg, i.e. identically to the case where it's omitted,
so BuildTarget.prefix doesn't get set (so the default is used).
Also clarify the error reported when a non-empty list is used.
-rw-r--r-- | mesonbuild/build.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 616a183..b1bf9d4 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -922,16 +922,17 @@ This will become a hard error in a future Meson release.''') name_prefix = kwargs['name_prefix'] if isinstance(name_prefix, list): if name_prefix: - raise InvalidArguments('name_prefix 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 - self.name_prefix_set = True + raise InvalidArguments('name_prefix array must be empty to signify default.') + else: + if not isinstance(name_prefix, str): + raise InvalidArguments('name_prefix must be a string.') + self.prefix = name_prefix + self.name_prefix_set = True if 'name_suffix' in kwargs: name_suffix = kwargs['name_suffix'] if isinstance(name_suffix, list): if name_suffix: - raise InvalidArguments('name_suffix array must be empty to signify null.') + raise InvalidArguments('name_suffix array must be empty to signify default.') else: if not isinstance(name_suffix, str): raise InvalidArguments('name_suffix must be a string.') |