Bug 1269787 - Choose tier for GENERATED_FILES based on extension; r?glandium
Some generated files will depend on other generated files, but still
need to be in the export tier because they are C++ headers.
MozReview-Commit-ID: AFvp92lF0xy
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -502,17 +502,24 @@ class RecursiveMakeBackend(CommonBackend
else:
backend_file.write('%s := %s\n' % (k, v))
elif isinstance(obj, HostDefines):
self._process_defines(obj, backend_file, which='HOST_DEFINES')
elif isinstance(obj, Defines):
self._process_defines(obj, backend_file)
elif isinstance(obj, GeneratedFile):
- tier = 'misc' if any(isinstance(f, ObjDirPath) for f in obj.inputs) else 'export'
+ export_suffixes = (
+ '.c',
+ '.cpp',
+ '.h',
+ '.inc',
+ '.py',
+ )
+ tier = 'export' if any(f.endswith(export_suffixes) for f in obj.outputs) else 'misc'
self._no_skip[tier].add(backend_file.relobjdir)
first_output = obj.outputs[0]
dep_file = "%s.pp" % first_output
backend_file.write('%s:: %s\n' % (tier, first_output))
for output in obj.outputs:
if output != first_output:
backend_file.write('%s: %s ;\n' % (output, first_output))
backend_file.write('GARBAGE += %s\n' % output)