MCPcopy Create free account
hub / github.com/DFHack/dfhack / GetCompilationInfoForFile

Function GetCompilationInfoForFile

.ycm_extra_conf.py:124–140  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

122
123
124def GetCompilationInfoForFile(filename):
125 # The compilation_commands.json file generated by CMake does not have entries
126 # for header files. So we do our best by asking the db for flags for a
127 # corresponding source file, if any. If one exists, the flags for that file
128 # should be good enough.
129 if IsHeaderFile(filename):
130 for alternative in PotentialAlternatives(filename):
131 if os.path.exists(alternative):
132 compilation_info = database.GetCompilationInfoForFile(
133 alternative
134 )
135
136 if compilation_info.compiler_flags_:
137 return compilation_info
138 return None
139 else:
140 return database.GetCompilationInfoForFile(filename)
141
142
143def FlagsForFile(filename, **kwargs):

Callers 1

FlagsForFileFunction · 0.85

Calls 3

IsHeaderFileFunction · 0.85
PotentialAlternativesFunction · 0.85
existsMethod · 0.45

Tested by

no test coverage detected