55 '-isystem',
"/opt/ros/%s/include" % os.environ.get(
'ROS_DISTRO',
'indigo'),
56 '-isystem',
'/usr/include/Poco',
57 '-isystem',
'/usr/include',
60 '-I',
'../devel/include',
62 '-DROSCONSOLE_BACKEND_LOG4CXX',
76 compilation_database_folder =
'' 78 if os.path.exists( compilation_database_folder ):
79 database = ycm_core.CompilationDatabase( compilation_database_folder )
83 SOURCE_EXTENSIONS = [
'.cpp',
'.cxx',
'.cc',
'.c',
'.m',
'.mm' ]
86 return os.path.dirname( os.path.abspath( __file__ ) )
90 if not working_directory:
93 make_next_absolute =
False 94 path_flags = [
'-isystem',
'-I',
'-iquote',
'--sysroot=' ]
98 if make_next_absolute:
99 make_next_absolute =
False 100 if not flag.startswith(
'/' ):
101 new_flag = os.path.join( working_directory, flag )
103 for path_flag
in path_flags:
104 if flag == path_flag:
105 make_next_absolute =
True 108 if flag.startswith( path_flag ):
109 path = flag[ len( path_flag ): ]
110 new_flag = path_flag + os.path.join( working_directory, path )
114 new_flags.append( new_flag )
119 extension = os.path.splitext( filename )[ 1 ]
120 return extension
in [
'.h',
'.hxx',
'.hpp',
'.hh' ]
129 basename = os.path.splitext( filename )[ 0 ]
130 for extension
in SOURCE_EXTENSIONS:
131 replacement_file = basename + extension
132 if os.path.exists( replacement_file ):
133 compilation_info = database.GetCompilationInfoForFile(
135 if compilation_info.compiler_flags_:
136 return compilation_info
138 return database.GetCompilationInfoForFile( filename )
146 if not compilation_info:
150 compilation_info.compiler_flags_,
151 compilation_info.compiler_working_dir_ )
157 'flags': final_flags,