def _AddBuildTargets(target, roots, add_if_no_ancestor, result):
  if target.visited:
    return

  target.visited = True
  target.in_roots = not target.back_deps and target in roots

  for back_dep_target in target.back_deps:
    _AddBuildTargets(back_dep_target, roots, False, result)
    target.added_to_compile_targets |= back_dep_target.added_to_compile_targets
    target.in_roots |= back_dep_target.in_roots

  # Always add 'executable' targets. Even though they may be built by other
  # targets that depend upon them it makes detection of what is going to be
  # built easier.
  if target.in_roots and \
        (target.is_executable or
         (not target.added_to_compile_targets and
          (add_if_no_ancestor or target.requires_build))):
    result.add(target)
    target.added_to_compile_targets = True
Recurses through all targets that depend on |target|, adding all targets
dataset/ETHPy150Open pyokagan/gyp/pylib/gyp/generator/analyzer.py/_AddBuildTargets