parameters: (out_dir, filename)
return_statement: return [target for target in output_lines
            if target and (target.endswith('.o') or target.endswith('.obj'))]
docstring: Returns a list of build outputs for filename.
  
    The list is generated by invoking 'ninja -t query' tool to retrieve a list of
    inputs and outputs of |filename|. This list is then filtered to only include
    .o and .obj outputs.
  
    Args:
      out_dir: (String) Absolute path to ninja build output directory.
      filename: (String) Absolute path to source file.
  
    Returns:
      (List of Strings) List of target names. Will return [] if |filename| doesn't
          yield any .o or .obj outputs.
docstring_summary: Returns a list of build outputs for filename.
docstring_tokens: Returns a list of build outputs for filename .
function: def GetNinjaBuildOutputsForSourceFile(out_dir, filename):
    """Returns a list of build outputs for filename.
  
    The list is generated by invoking 'ninja -t query' tool to retrieve a list of
    inputs and outputs of |filename|. This list is then filtered to only include
    .o and .obj outputs.
  
    Args:
      out_dir: (String) Absolute path to ninja build output directory.
      filename: (String) Absolute path to source file.
  
    Returns:
      (List of Strings) List of target names. Will return [] if |filename| doesn't
          yield any .o or .obj outputs.
    """
    # Ninja needs the path to the source file relative to the output build
    # directory.
    rel_filename = os.path.relpath(filename, out_dir)
  
    p = subprocess.Popen(['ninja', '-C', out_dir, '-t', 'query', rel_filename],
                         stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                         universal_newlines=True)
    stdout, _ = p.communicate()
    if p.returncode != 0:
      return []
  
    # The output looks like:
    #   ../../relative/path/to/source.cc:
    #     outputs:
    #       obj/reative/path/to/target.source.o
    #       obj/some/other/target2.source.o
    #       another/target.txt
    #
    outputs_text = stdout.partition('\n  outputs:\n')[2]
    output_lines = [line.strip() for line in outputs_text.split('\n')]
    return [target for target in output_lines
            if target and (target.endswith('.o') or target.endswith('.obj'))]
function_tokens: def GetNinjaBuildOutputsForSourceFile ( out_dir , filename ) : # Ninja needs the path to the source file relative to the output build # directory. rel_filename = os . path . relpath ( filename , out_dir ) p = subprocess . Popen ( [ 'ninja' , '-C' , out_dir , '-t' , 'query' , rel_filename ] , stdout = subprocess . PIPE , stderr = subprocess . STDOUT , universal_newlines = True ) stdout , _ = p . communicate ( ) if p . returncode != 0 : return [ ] # The output looks like: #   ../../relative/path/to/source.cc: #     outputs: #       obj/reative/path/to/target.source.o #       obj/some/other/target2.source.o #       another/target.txt # outputs_text = stdout . partition ( '\n  outputs:\n' ) [ 2 ] output_lines = [ line . strip ( ) for line in outputs_text . split ( '\n' ) ] return [ target for target in output_lines if target and ( target . endswith ( '.o' ) or target . endswith ( '.obj' ) ) ]