Bug 1416062 - Generated header files and wrappers should be in the installed-files group; r=chmanchester draft
authorMike Shal <mshal@mozilla.com>
Mon, 21 Nov 2016 15:52:42 -0500
changeset 698509 5336de61d142be334c7c5f3012d4fea5daddcf93
parent 698508 c76130686d2ad2eb33d19f1442d88592ceec9ea3
child 698510 d13f4b59cfd35b79cb183f0a9183df263f9ebecc
push id89317
push userbmo:mshal@mozilla.com
push dateWed, 15 Nov 2017 22:12:01 +0000
reviewerschmanchester
bugs1416062
milestone59.0a1
Bug 1416062 - Generated header files and wrappers should be in the installed-files group; r=chmanchester We'll need all of these before compilation, so stick them all in the same group. MozReview-Commit-ID: Gl1zvnb1Bjt
python/mozbuild/mozbuild/backend/tup.py
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -270,16 +270,21 @@ class TupOnly(CommonBackend, PartialBack
 
     def _process_generated_file(self, backend_file, obj):
         # TODO: These are directories that don't work in the tup backend
         # yet, because things they depend on aren't built yet.
         skip_directories = (
             'layout/style/test', # HostSimplePrograms
             'toolkit/library', # libxul.so
         )
+        install_exts = (
+            '.h',
+            '.inc',
+            'new', # 'new' is an output from make-stl-wrappers.py
+        )
         if obj.script and obj.method and obj.relobjdir not in skip_directories:
             backend_file.export_shell()
             cmd = self._py_action('file_generate')
             cmd.extend([
                 obj.script,
                 obj.method,
                 obj.outputs[0],
                 '%s.pp' % obj.outputs[0], # deps file required
@@ -287,21 +292,24 @@ class TupOnly(CommonBackend, PartialBack
             full_inputs = [f.full_path for f in obj.inputs]
             cmd.extend(full_inputs)
             cmd.extend(shell_quote(f) for f in obj.flags)
 
             outputs = []
             outputs.extend(obj.outputs)
             outputs.append('%s.pp' % obj.outputs[0])
 
+            extra_outputs = [self._installed_files] if any(f.endswith(install_exts) for f in obj.outputs) else None
+
             backend_file.rule(
                 display='python {script}:{method} -> [%o]'.format(script=obj.script, method=obj.method),
                 cmd=cmd,
                 inputs=full_inputs,
                 outputs=outputs,
+                extra_outputs=extra_outputs,
             )
 
     def _process_defines(self, backend_file, obj, host=False):
         defines = list(obj.get_defines())
         if defines:
             if host:
                 backend_file.host_defines = defines
             else: