Bug 991983 - Set GARBAGE for GeneratedSources in the recursivemake backend. r=gps

GARBAGE is an implementation detail of the recursivemake backend, and
doesn't need to spill in what the emitter emits.
This commit is contained in:
Mike Hommey 2015-05-14 16:47:54 +09:00
parent 477721865b
commit fc645ba14f
3 changed files with 6 additions and 10 deletions

View File

@ -454,9 +454,12 @@ class RecursiveMakeBackend(CommonBackend):
'.rs': 'RSSRCS',
'.S': 'SSRCS',
}
var = suffix_map[obj.canonical_suffix]
variables = [suffix_map[obj.canonical_suffix]]
if isinstance(obj, GeneratedSources):
variables.append('GARBAGE')
for f in sorted(obj.files):
backend_file.write('%s += %s\n' % (var, f))
for var in variables:
backend_file.write('%s += %s\n' % (var, f))
elif isinstance(obj, HostSources):
suffix_map = {
'.c': 'HOST_CSRCS',

View File

@ -775,9 +775,6 @@ class TreeMetadataEmitter(LoggingMixin):
if ext not in allowed_suffixes:
raise SandboxValidationError(
'%s has an unknown file type.' % f, context)
if variable.startswith('GENERATED_'):
l = passthru.variables.setdefault('GARBAGE', [])
l.append(f)
# Now sort the files to let groupby work.
sorted_files = sorted(context[variable], key=canonical_suffix_for_file)

View File

@ -758,11 +758,7 @@ class TestEmitterBasic(unittest.TestCase):
reader = self.reader('generated-sources')
objs = self.read_topsrcdir(reader)
self.assertEqual(len(objs), 7)
# GENERATED_SOURCES automatically generate GARBAGE definitions.
garbage = [o for o in objs if isinstance(o, VariablePassthru)]
self.assertEqual(len(garbage), 1)
self.assertEqual(len(objs), 6)
generated_sources = [o for o in objs if isinstance(o, GeneratedSources)]
self.assertEqual(len(generated_sources), 6)