MCPcopy Create free account
hub / github.com/MegEngine/MegCC / FlagsForFile

Function FlagsForFile

runtime/.ycm_extra_conf.py:131–150  ·  view source on GitHub ↗
(filename, **kwargs)

Source from the content-addressed store, hash-verified

129# This is the entry point; this function is called by ycmd to produce flags for
130# a file.
131def FlagsForFile(filename, **kwargs):
132 final_flags = []
133 if database:
134 # Bear in mind that compilation_info.compiler_flags_ does NOT return a
135 # python list, but a "list-like" StringVec object
136 compilation_info = GetCompilationInfoForFile(filename)
137 if not compilation_info:
138 return None
139
140 final_flags = MakeRelativePathsInFlagsAbsolute(
141 compilation_info.compiler_flags_,
142 compilation_info.compiler_working_dir_)
143
144 final_flags = final_flags + MakeRelativePathsInFlagsAbsolute(flags)
145 # caused by database do not generate database for cuh or h file, which may include file abspath files
146 final_flags = final_flags + [
147 "-I{}".format(os.path.dirname(os.path.abspath(filename)))
148 ]
149
150 return {"flags": final_flags, "do_cache": True}
151
152
153def Settings(filename, **kwargs):

Callers 1

SettingsFunction · 0.70

Calls 2

Tested by

no test coverage detected