tools/clang/scripts/test_tool.py
def _GenerateCompileCommands(files, include_paths):
  """Returns a JSON string containing a compilation database for the input."""
  # Note: in theory, backslashes in the compile DB should work but the tools
  # that write compile DBs and the tools that read them don't agree on the
  # escaping convention: https://llvm.org/bugs/show_bug.cgi?id=19687
  files = [f.replace('\\', '/') for f in files]
  include_path_flags = ' '.join('-I %s' % include_path.replace('\\', '/')
                                for include_path in include_paths)
  return json.dumps([{'directory': os.path.dirname(f),
                      'command': 'clang++ -std=c++14 -fsyntax-only %s -c %s' % (
                          include_path_flags, os.path.basename(f)),
                      'file': os.path.basename(f)} for f in files], indent=2)
Returns a JSON string containing a compilation database for the input.
Returns a JSON string containing a compilation database for the input.
Returns a JSON string containing a compilation database for the input .
def _GenerateCompileCommands(files, include_paths):
  files = [f.replace('\\', '/') for f in files]
  include_path_flags = ' '.join('-I %s' % include_path.replace('\\', '/')
                                for include_path in include_paths)
  return json.dumps([{'directory': os.path.dirname(f),
                      'command': 'clang++ -std=c++14 -fsyntax-only %s -c %s' % (
                          include_path_flags, os.path.basename(f)),
                      'file': os.path.basename(f)} for f in files], indent=2)
def _GenerateCompileCommands ( files , include_paths ) : files = [ f . replace ( '\\' , '/' ) for f in files ] include_path_flags = ' ' . join ( '-I %s' % include_path . replace ( '\\' , '/' ) for include_path in include_paths ) return json . dumps ( [ { 'directory' : os . path . dirname ( f ) , 'command' : 'clang++ -std=c++14 -fsyntax-only %s -c %s' % ( include_path_flags , os . path . basename ( f ) ) , 'file' : os . path . basename ( f ) } for f in files ] , indent = 2 )
Returns a JSON string containing a compilation database for the input.
Returns a JSON string containing a compilation database for the input .
"""Returns a JSON string containing a compilation database for the input.""" # Note: in theory, backslashes in the compile DB should work but the tools # that write compile DBs and the tools that read them don't agree on the # escaping convention: https://llvm.org/bugs/show_bug.cgi?id=19687
files
include_paths