Fix runtime_deps for elided targets

Target types that are represented by phony aliases can be omitted if
they lack any real inputs (dependencies that would show up on the ninja
build line). However, these targets could still have runtime_deps, so
this CL ensuresthat a .runtime_deps file is generated even if there is
no dependency_output_file or dependency_output_phony.

Change-Id: Iddaac69050a531bd8876d063812fba32927acb87
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/10380
Reviewed-by: Petr Hosek <phosek@google.com>
Commit-Queue: Petr Hosek <phosek@google.com>
diff --git a/src/gn/runtime_deps.cc b/src/gn/runtime_deps.cc
index 1213c35..f04857f 100644
--- a/src/gn/runtime_deps.cc
+++ b/src/gn/runtime_deps.cc
@@ -188,8 +188,10 @@
     } else if (target->dependency_output_file()) {
       output_file =
           OutputFile(target->dependency_output_file()->value() + extension);
-    } else if (target->dependency_output_phony()) {
-      // If the dependency is a phony target, there is no file to add an additional
+    } else {
+      // If there is no dependency_output_file, this target's dependency output
+      // is either a phony alias or was elided entirely (due to lack of real
+      // inputs). In either case, there is no file to add an additional
       // extension to, so we should compute our own name in the OBJ BuildDir.
       output_file = GetBuildDirForTargetAsOutputFile(target, BuildDirType::OBJ);
       output_file->value().append(target->GetComputedOutputName());