Bug 1269787 - Choose tier for GENERATED_FILES based on extension; r?glandium draft
authorMike Shal <mshal@mozilla.com>
Fri, 29 Apr 2016 13:41:41 -0400
changeset 362961 26d457bff416011e7f349c8158b580e64a1eb976
parent 362793 9f866b72af4a3c4520205d55c60aa74548682c4a
child 362962 566f5c6fa2c9ae13addbf90b13d8f15a02b410f7
push id17070
push userbmo:mshal@mozilla.com
push dateTue, 03 May 2016 16:57:06 +0000
reviewersglandium
bugs1269787
milestone49.0a1
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
python/mozbuild/mozbuild/backend/recursivemake.py
--- 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)