From 37a962e90c38f094819973d5d45fa25054caa1ca Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne <maarten@treewalker.org> Date: Tue, 19 Feb 2019 01:10:35 +0100 Subject: Allow File arguments in extract_objects() arguments Passed strings are converted to Files, but passing a File directly wasn't supported yet. --- mesonbuild/build.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mesonbuild/build.py') diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 702b338..e8aa8f4 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -722,9 +722,12 @@ class BuildTarget(Target): def extract_objects(self, srclist): obj_src = [] for src in srclist: - if not isinstance(src, str): - raise MesonException('Object extraction arguments must be strings.') - src = File(False, self.subdir, src) + if isinstance(src, str): + src = File(False, self.subdir, src) + elif isinstance(src, File): + FeatureNew('File argument for extract_objects', '0.50.0').use(self.subproject) + else: + raise MesonException('Object extraction arguments must be strings or Files.') # FIXME: It could be a generated source if src not in self.sources: raise MesonException('Tried to extract unknown source %s.' % src) -- cgit v1.1