tools/clang/pylib/clang/compile_db.py
def GenerateWithNinja(path, targets=None):
  """Generates a compile database using ninja.

  Args:
    path: The build directory to generate a compile database for.
    targets: Additional targets to pass to ninja.

  Returns:
    List of the contents of the compile database.
  """
  # TODO(dcheng): Ensure that clang is enabled somehow.

  # First, generate the compile database.
  ninja_path = GetNinjaPath()
  if not os.path.exists(ninja_path):
    ninja_path = shutil.which('ninja')
  if targets is None:
    targets = []
  json_compile_db = subprocess.check_output(
      [ninja_path, '-C', path] + targets +
      ['-t', 'compdb', 'cc', 'cxx', 'objc', 'objcxx'])
  return json.loads(json_compile_db)
Generates a compile database using ninja.

  Args:
    path: The build directory to generate a compile database for.
    targets: Additional targets to pass to ninja.

  Returns:
    List of the contents of the compile database.
  
Generates a compile database using ninja.
Generates a compile database using ninja .
def GenerateWithNinja(path, targets=None):
  ninja_path = GetNinjaPath()
  if not os.path.exists(ninja_path):
    ninja_path = shutil.which('ninja')
  if targets is None:
    targets = []
  json_compile_db = subprocess.check_output(
      [ninja_path, '-C', path] + targets +
      ['-t', 'compdb', 'cc', 'cxx', 'objc', 'objcxx'])
  return json.loads(json_compile_db)
def GenerateWithNinja ( path , targets = None ) : ninja_path = GetNinjaPath ( ) if not os . path . exists ( ninja_path ) : ninja_path = shutil . which ( 'ninja' ) if targets is None : targets = [ ] json_compile_db = subprocess . check_output ( [ ninja_path , '-C' , path ] + targets + [ '-t' , 'compdb' , 'cc' , 'cxx' , 'objc' , 'objcxx' ] ) return json . loads ( json_compile_db )
Generates a compile database using ninja.
Generates a compile database using ninja .
"""Generates a compile database using ninja.

  Args:
    path: The build directory to generate a compile database for.
    targets: Additional targets to pass to ninja.

  Returns:
    List of the contents of the compile database.
  """ # TODO(dcheng): Ensure that clang is enabled somehow. # First, generate the compile database.
List of the contents of the compile database.
List of the contents of the compile database .
path
The build directory to generate a compile database for.
The build directory to generate a compile database for .
targets
Additional targets to pass to ninja.
Additional targets to pass to ninja .