Bug 916257 - part 3 - write ALL_IPDLSRCS and CPPSRCS in one go; r=gps
☠☠ backed out by 853f3f44cb3b ☠ ☠
authorNathan Froyd <froydnj@mozilla.com>
Fri, 13 Sep 2013 15:09:53 -0400
changeset 155195 e068176c481409155464da7cf527e797beba2320
parent 155194 e9a59bc50ffb2e0ae373d4d85c2865d92430d8fa
child 155196 aa691853d349c7c77f11eb0368ecae065ec5099b
push idunknown
push userunknown
push dateunknown
reviewersgps
bugs916257
milestone26.0a1
Bug 916257 - part 3 - write ALL_IPDLSRCS and CPPSRCS in one go; r=gps
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -1,15 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import unicode_literals
 
 import errno
+import itertools
 import logging
 import os
 import types
 
 import mozbuild.makeutil as mozmakeutil
 from mozpack.copier import FilePurger
 from mozpack.manifests import (
     InstallManifest,
@@ -284,31 +285,33 @@ class RecursiveMakeBackend(CommonBackend
             self.summary.managed_count += 1
 
 
         # 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)
-            def files_from(ipdl):
-                base = os.path.basename(ipdl)
-                root, ext = os.path.splitext(base)
+        sorted_ipdl_sources = list(sorted(self._ipdl_sources))
+        mk.add_statement('ALL_IPDLSRCS := %s\n' % ' '.join(sorted_ipdl_sources))
+
+        def files_from(ipdl):
+            base = os.path.basename(ipdl)
+            root, ext = os.path.splitext(base)
 
-                # 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
+            # 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)))
+        ipdl_cppsrcs = itertools.chain(*[files_from(p) for p in sorted_ipdl_sources])
+        mk.add_statement('CPPSRCS := %s\n' % ' '.join(ipdl_cppsrcs))
 
         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