summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-01-10 15:49:43 -0800
committerDylan Baker <dylan@pnwbakers.com>2025-10-15 10:21:46 -0700
commit6b1bf61dacba30a4b4a079cde640838c665a393f (patch)
treee05b722cc8f049363706c95d582d498433b9fdda /mesonbuild
parent867876cba9b94d9ffc691f18b4a27d394c335878 (diff)
downloadmeson-6b1bf61dacba30a4b4a079cde640838c665a393f.tar.gz
build: remove validation for name prefix and suffix
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/build.py32
-rw-r--r--mesonbuild/modules/python3.py2
2 files changed, 9 insertions, 25 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 0ce48b918..10f2b3cac 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1292,30 +1292,14 @@ class BuildTarget(Target):
if not os.path.isfile(trial):
raise InvalidArguments(f'Tried to add non-existing resource {r}.')
self.resources = resources
- if kwargs.get('name_prefix') is not None:
- name_prefix = kwargs['name_prefix']
- if isinstance(name_prefix, list):
- if name_prefix:
- 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 kwargs.get('name_suffix') is not None:
- name_suffix = kwargs['name_suffix']
- if isinstance(name_suffix, list):
- if name_suffix:
- 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.')
- if name_suffix == '':
- raise InvalidArguments('name_suffix should not be an empty string. '
- 'If you want meson to use the default behaviour '
- 'for each platform pass `[]` (empty array)')
- self.suffix = name_suffix
- self.name_suffix_set = True
+ name_prefix = kwargs.get('name_prefix')
+ if name_prefix is not None:
+ self.prefix = name_prefix
+ self.name_prefix_set = True
+ name_suffix = kwargs.get('name_suffix')
+ if name_suffix is not None:
+ self.suffix = name_suffix
+ self.name_suffix_set = True
self.implicit_include_directories = kwargs.get('implicit_include_directories', True)
if not isinstance(self.implicit_include_directories, bool):
raise InvalidArguments('Implicit_include_directories must be a boolean.')
diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py
index 2e6779ab2..69ad1eece 100644
--- a/mesonbuild/modules/python3.py
+++ b/mesonbuild/modules/python3.py
@@ -50,7 +50,7 @@ class Python3Module(ExtensionModule):
# On Windows the extension is pyd for some unexplainable reason.
suffix = 'pyd'
else:
- suffix = []
+ suffix = None
kwargs['name_prefix'] = ''
kwargs['name_suffix'] = suffix
return self.interpreter.build_target(state.current_node, args, kwargs, SharedModule)