 +    sources = spec.get('sources', []) + extra_sources
 +    if sources:
 +      link_deps = self.WriteSources(config, sources, sources_predepends)
++      # Some actions/rules output 'sources' that are already object files.
++      link_deps += [f for f in sources if f.endswith('.o')]
 +
 +    # The final output of our target depends on the last output of the
 +    # above steps.

+}
+
+NINJA_BASE = """\
+# Build directory.
+b = ninja
+
+cc = %(cc)s

 class TestGypMSVS(TestGypBase):
   """
   Subclass for testing the GYP Visual Studio generator.
@@ -705,6 +746,7 @@ format_class_list = [
   TestGypGypd,
   TestGypMake,
   TestGypMSVS,
