interpreter: extract_objects provides a valid source

This ensures that there is no warnings when running meson on
test cases/common/22 object extraction.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pull/9617/head
Paolo Bonzini 3 years ago committed by Nirbheek Chauhan
parent 47ba919b21
commit 8581a2b122
  1. 9
      mesonbuild/interpreter/interpreter.py
  2. 6
      unittests/allplatformstests.py

@ -90,11 +90,12 @@ if T.TYPE_CHECKING:
# Input source types passed to Targets
SourceInputs = T.Union[mesonlib.File, build.GeneratedList, build.BuildTarget, build.BothLibraries,
build.CustomTargetIndex, build.CustomTarget, build.GeneratedList, str]
# Input source types passed to the build.Target5 classes
build.CustomTargetIndex, build.CustomTarget, build.GeneratedList,
build.ExtractedObjects, str]
# Input source types passed to the build.Target classes
SourceOutputs = T.Union[mesonlib.File, build.GeneratedList,
build.BuildTarget, build.CustomTargetIndex, build.CustomTarget,
build.GeneratedList]
build.ExtractedObjects, build.GeneratedList]
def stringifyUserArguments(args, quote=False):
@ -2573,7 +2574,7 @@ Try setting b_lundef to false instead.'''.format(self.coredata.options[OptionKey
results.append(s)
elif isinstance(s, (build.GeneratedList, build.BuildTarget,
build.CustomTargetIndex, build.CustomTarget,
build.GeneratedList)):
build.ExtractedObjects)):
results.append(s)
else:
raise InterpreterException(f'Source item is {s!r} instead of '

@ -3540,6 +3540,12 @@ class AllPlatformTests(BasePlatformTests):
self.build()
self.run_tests()
def test_extract_objects_custom_target_no_warning(self):
testdir = os.path.join(self.common_test_dir, '22 object extraction')
out = self.init(testdir)
self.assertNotRegex(out, "WARNING:.*can't be converted to File object")
def test_multi_output_custom_target_no_warning(self):
testdir = os.path.join(self.common_test_dir, '228 custom_target source')

Loading…
Cancel
Save