Bug 1122812 - part 4 - update the Visual Studio backend for UnifiedSources changes; r=mshal

With the previous changes, we can now tell Visual Studio about the
actual unified files, rather than the files that are #include'd in them.
I believe this is much closer to what Visual Studio wants to see, and
enables things like Intellisense to work properly.
This commit is contained in:
Nathan Froyd 2015-02-05 14:55:54 -05:00
parent 4f29a0e3a7
commit a87ff1ab76

View File

@ -110,7 +110,9 @@ class VisualStudioBackend(CommonBackend):
self._add_sources(reldir, obj)
elif isinstance(obj, UnifiedSources):
self._add_sources(reldir, obj)
# XXX we should be letting CommonBackend.consume_object call this
# for us instead.
self._process_unified_sources(obj);
elif isinstance(obj, Library):
self._libs_to_paths[obj.basename] = reldir
@ -131,6 +133,15 @@ class VisualStudioBackend(CommonBackend):
s = self._paths_to_sources.setdefault(reldir, set())
s.update(obj.files)
def _process_unified_sources(self, obj):
reldir = getattr(obj, 'relativedir', None)
s = self._paths_to_sources.setdefault(reldir, set())
if obj.have_unified_mapping:
s.update(unified_file for unified_file, _ in obj.unified_source_mapping)
else:
s.update(obj.files)
def consume_finished(self):
out_dir = self._out_dir
try: