Bug 916257 - part 2 - separate out files-from-this-ipdl logic from writing CPPSRCS; r=gps
authorNathan Froyd <froydnj@mozilla.com>
Fri, 13 Sep 2013 15:03:15 -0400
changeset 147068 8dfc5c8b3c8b
parent 147067 046a32ac9131
child 147069 60933bd9e217
push id33783
push usernfroyd@mozilla.com
push dateFri, 13 Sep 2013 23:03:18 +0000
treeherdermozilla-inbound@60933bd9e217 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs916257
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 916257 - part 2 - separate out files-from-this-ipdl logic from writing CPPSRCS; r=gps
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -285,25 +285,29 @@ class RecursiveMakeBackend(CommonBackend
 
         # Write out a master list of all IPDL source files.
         ipdls = FileAvoidWrite(os.path.join(self.environment.topobjdir,
             'ipc', 'ipdl', 'ipdlsrcs.mk'))
         mk = mozmakeutil.Makefile()
 
         for p in sorted(self._ipdl_sources):
             mk.add_statement('ALL_IPDLSRCS += %s\n' % p)
-            base = os.path.basename(p)
-            root, ext = os.path.splitext(base)
+            def files_from(ipdl):
+                base = os.path.basename(ipdl)
+                root, ext = os.path.splitext(base)
 
-            # Both .ipdl and .ipdlh become .cpp files
-            mk.add_statement('CPPSRCS += %s.cpp\n' % root)
-            if ext == '.ipdl':
-                # .ipdl also becomes Child/Parent.cpp files
-                mk.add_statement('CPPSRCS += %sChild.cpp\n' % root)
-                mk.add_statement('CPPSRCS += %sParent.cpp\n' % root)
+                # Both .ipdl and .ipdlh become .cpp files
+                files = ['%s.cpp' % root]
+                if ext == '.ipdl':
+                    # .ipdl also becomes Child/Parent.cpp files
+                    files.extend(['%sChild.cpp' % root,
+                                  '%sParent.cpp' % root])
+                return files
+
+            mk.add_statement('CPPSRCS += %s\n' % ' '.join(files_from(p)))
 
         mk.add_statement('IPDLDIRS := %s\n' % ' '.join(sorted(set(os.path.dirname(p)
             for p in self._ipdl_sources))))
 
         mk.dump(ipdls)
 
         self._update_from_avoid_write(ipdls.close())
         self.summary.managed_count += 1