aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2023-11-13 14:32:13 -0500
committerJussi Pakkanen <jpakkane@gmail.com>2023-11-13 23:43:42 +0200
commitcddf2e9d872ebbc673d2595bc176a0572d258222 (patch)
tree32db524e7c79b5d722483d27b65bbf91f92e7cbf /mesonbuild/build.py
parent2da53e943ad9d44c4416ec4cca8ef549bf40d7b3 (diff)
downloadmeson-cddf2e9d872ebbc673d2595bc176a0572d258222.zip
meson-cddf2e9d872ebbc673d2595bc176a0572d258222.tar.gz
meson-cddf2e9d872ebbc673d2595bc176a0572d258222.tar.bz2
fix another regression in converting build_target kwargs to typed_kwargs
This time we have a case where people are passing non-objects by using them as str | File, which we never warned about and silently accepted. If it was passed via custom_target outputs we *would* error out, interestingly enough. At the backend layer, we just pass them directly to the linker... which is valid, if we misdetected what's a valid linker input or people just used funny names. In particular, the mingw toolchain allows passing a *.def file directly, and some people are doing that. If we do want to allow this, we should do it consistently. For now, just follow the current theme of what's expected, but do so by warning instead of fatally erroring, for cases where users were able to do it in the past.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 9c27b23..12e7cb5 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -854,9 +854,12 @@ class BuildTarget(Target):
def process_objectlist(self, objects):
assert isinstance(objects, list)
+ deprecated_non_objects = []
for s in objects:
if isinstance(s, (str, File, ExtractedObjects)):
self.objects.append(s)
+ if not isinstance(s, ExtractedObjects) and not is_object(s):
+ deprecated_non_objects.append(s)
elif isinstance(s, (CustomTarget, CustomTargetIndex, GeneratedList)):
non_objects = [o for o in s.get_outputs() if not is_object(o)]
if non_objects:
@@ -864,6 +867,9 @@ class BuildTarget(Target):
self.generated.append(s)
else:
raise InvalidArguments(f'Bad object of type {type(s).__name__!r} in target {self.name!r}.')
+ if deprecated_non_objects:
+ FeatureDeprecated.single_use(f'Source file {deprecated_non_objects[0]} in the \'objects\' kwarg is not an object.',
+ '1.3.0', self.subproject)
def process_sourcelist(self, sources: T.List['SourceOutputs']) -> None:
"""Split sources into generated and static sources.