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.
@@ -922,8 +922,9 @@ 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 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
@@ -931,7 +932,7 @@ This will become a hard error in a future Meson release.''')
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.')
