mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
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:
parent
477721865b
commit
fc645ba14f
@ -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',
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user