Bug 1122812 - part 2 - factor out the grabbing of an object's backend.mk; r=mshal

UnifiedSources will be processed outside of consume_object, so we need
some way of accessing the backend file for an object outside of
consume_object as well.
This commit is contained in:
Nathan Froyd 2015-02-05 14:25:14 -05:00
parent 1750896125
commit 267d7d67ca

View File

@ -328,17 +328,20 @@ class RecursiveMakeBackend(CommonBackend):
'tools': set(),
}
def _get_backend_file_for(self, obj):
if obj.objdir not in self._backend_files:
self._backend_files[obj.objdir] = \
BackendMakeFile(obj.srcdir, obj.objdir, obj.config,
obj.topsrcdir, self.environment.topobjdir)
return self._backend_files[obj.objdir]
def consume_object(self, obj):
"""Write out build files necessary to build with recursive make."""
if not isinstance(obj, ContextDerived):
return
if obj.objdir not in self._backend_files:
self._backend_files[obj.objdir] = \
BackendMakeFile(obj.srcdir, obj.objdir, obj.config,
obj.topsrcdir, self.environment.topobjdir)
backend_file = self._backend_files[obj.objdir]
backend_file = self._get_backend_file_for(obj)
CommonBackend.consume_object(self, obj)