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

Function FlagsForFile

runtime/test/.ycm_extra_conf.py:129–148  ·  view source on GitHub ↗
(filename, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers 1

SettingsFunction · 0.70

Calls 2

Tested by

no test coverage detected