Bug 1245763 - Group sources and linkables handling function cals in mozbuild.emitter. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 04 Feb 2016 13:40:10 +0900
changeset 283076 ef28fb13dc0b8044567120e3eb9619a9f9a48339
parent 283075 75fe50edcf9aca16125fa9abf8011e6b36ba7634
child 283077 b77146ab68722ee25345c322c950898a9a9f1d85
push id29974
push usercbook@mozilla.com
push dateFri, 05 Feb 2016 10:53:43 +0000
treeherdermozilla-central@1dbe350b57b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1245763
milestone47.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 1245763 - Group sources and linkables handling function cals in mozbuild.emitter. r=gps
python/mozbuild/mozbuild/frontend/emitter.py
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -366,16 +366,25 @@ class TreeMetadataEmitter(LoggingMixin):
         # context more or less truthful about where the external library is.
         context = Context(config=self.config)
         context.add_source(mozpath.join(self.config.topsrcdir, dir, 'dummy'))
         if force_static:
             return ExternalStaticLibrary(context, name)
         else:
             return ExternalSharedLibrary(context, name)
 
+    def _handle_linkables(self, context, passthru):
+        for obj in self._process_sources(context, passthru):
+            yield obj
+
+        self._handle_programs(context)
+
+        for obj in self._handle_libraries(context):
+            yield obj
+
     def _handle_libraries(self, context):
         host_libname = context.get('HOST_LIBRARY_NAME')
         libname = context.get('LIBRARY_NAME')
 
         if host_libname:
             if host_libname == libname:
                 raise SandboxValidationError('LIBRARY_NAME and '
                     'HOST_LIBRARY_NAME must have a different value', context)
@@ -620,37 +629,32 @@ class TreeMetadataEmitter(LoggingMixin):
             passthru.variables['IS_GYP_DIR'] = True
 
         dist_install = context['DIST_INSTALL']
         if dist_install is True:
             passthru.variables['DIST_INSTALL'] = True
         elif dist_install is False:
             passthru.variables['NO_DIST_INSTALL'] = True
 
-        for obj in self._process_sources(context, passthru):
-            yield obj
-
         generated_files = set()
         for obj in self._process_generated_files(context):
             generated_files.add(obj.output)
             yield obj
 
         for obj in self._process_test_harness_files(context):
             yield obj
 
         defines = context.get('DEFINES')
         if defines:
             yield Defines(context, defines)
 
         host_defines = context.get('HOST_DEFINES')
         if host_defines:
             yield HostDefines(context, host_defines)
 
-        self._handle_programs(context)
-
         simple_lists = [
             ('GENERATED_EVENTS_WEBIDL_FILES', GeneratedEventWebIDLFile),
             ('GENERATED_WEBIDL_FILES', GeneratedWebIDLFile),
             ('IPDL_SOURCES', IPDLFile),
             ('PREPROCESSED_TEST_WEBIDL_FILES', PreprocessedTestWebIDLFile),
             ('PREPROCESSED_WEBIDL_FILES', PreprocessedWebIDLFile),
             ('TEST_WEBIDL_FILES', TestWebIDLFile),
             ('WEBIDL_FILES', WebIDLFile),
@@ -740,17 +744,17 @@ class TreeMetadataEmitter(LoggingMixin):
                                          context);
 
         for c in components:
             if c.endswith('.manifest'):
                 yield ChromeManifestEntry(context, 'chrome.manifest',
                                           Manifest('components',
                                                    mozpath.basename(c)))
 
-        for obj in self._handle_libraries(context):
+        for obj in self._handle_linkables(context, passthru):
             yield obj
 
         for obj in self._process_test_manifests(context):
             yield obj
 
         for obj in self._process_jar_manifests(context):
             yield obj