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

Function FlagsForFile

compiler/.ycm_extra_conf.py:135–154  ·  view source on GitHub ↗
(filename, **kwargs)

Source from the content-addressed store, hash-verified

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

Callers 1

SettingsFunction · 0.70

Calls 2

Tested by

no test coverage detected