46 '-DUSE_CLANG_COMPLETER',
65 '/System/Library/Frameworks/Python.framework/Headers',
69 '../llvm/tools/clang/include',
75 './tests/gmock/gtest',
77 './tests/gmock/gtest/include',
81 './tests/gmock/include'
91 compilation_database_folder =
''
93 if os.path.exists( compilation_database_folder ):
94 database = ycm_core.CompilationDatabase( compilation_database_folder )
98 SOURCE_EXTENSIONS = [
'.hpp',
'h',
'.cpp',
'.cxx',
'.cc',
'.c',
'.m',
'.mm' ]
101 return os.path.dirname( os.path.abspath( __file__ ) )
105 if not working_directory:
108 make_next_absolute =
False
109 path_flags = [
'-isystem',
'-I',
'-iquote',
'--sysroot=' ]
113 if make_next_absolute:
114 make_next_absolute =
False
115 if not flag.startswith(
'/' ):
116 new_flag = os.path.join( working_directory, flag )
118 for path_flag
in path_flags:
119 if flag == path_flag:
120 make_next_absolute =
True
123 if flag.startswith( path_flag ):
124 path = flag[ len( path_flag ): ]
125 new_flag = path_flag + os.path.join( working_directory, path )
129 new_flags.append( new_flag )
134 extension = os.path.splitext( filename )[ 1 ]
135 return extension
in [
'.h',
'.hxx',
'.hpp',
'.hh' ]
144 basename = os.path.splitext( filename )[ 0 ]
145 for extension
in SOURCE_EXTENSIONS:
146 replacement_file = basename + extension
147 if os.path.exists( replacement_file ):
148 compilation_info = database.GetCompilationInfoForFile(
150 if compilation_info.compiler_flags_:
151 return compilation_info
153 return database.GetCompilationInfoForFile( filename )
161 if not compilation_info:
165 compilation_info.compiler_flags_,
166 compilation_info.compiler_working_dir_ )
172 final_flags.remove(
'-stdlib=libc++' )
180 'flags': final_flags,