本文整理匯總了Python中clang_helpers.PrepareClangFlags.remove方法的典型用法代碼示例。如果您正苦於以下問題:Python PrepareClangFlags.remove方法的具體用法?Python PrepareClangFlags.remove怎麽用?Python PrepareClangFlags.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類clang_helpers.PrepareClangFlags
的用法示例。
在下文中一共展示了PrepareClangFlags.remove方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: FlagsForFile
# 需要導入模塊: from clang_helpers import PrepareClangFlags [as 別名]
# 或者: from clang_helpers.PrepareClangFlags import remove [as 別名]
def FlagsForFile( filename ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = database.GetCompilationInfoForFile( filename )
final_flags = PrepareClangFlags(
MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ ),
filename )
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% YOU NEED IT.
try:
final_flags.remove( '-stdlib=libc++' )
except ValueError:
pass
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}
示例2: FlagsForFile
# 需要導入模塊: from clang_helpers import PrepareClangFlags [as 別名]
# 或者: from clang_helpers.PrepareClangFlags import remove [as 別名]
def FlagsForFile(filename):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = database.GetCompilationInfoForFile(filename)
final_flags = PrepareClangFlags(
MakeRelativePathsInFlagsAbsolute(compilation_info.compiler_flags_, compilation_info.compiler_working_dir_),
filename,
)
# NOTE: This is just for YouCompleteMe; it's highly likely that your project
# does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR
# ycm_extra_conf IF YOU'RE NOT 100% YOU NEED IT.
try:
final_flags.remove("-stdlib=libc++")
except ValueError:
pass
else:
relative_to = DirectoryOfThisScript()
# not handling double path delimiters...
if filename.startswith(relative_to):
subdir = filename[len(relative_to) :].split("/")[1]
else:
subdir = None
final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to, subdir)
return {"flags": final_flags, "do_cache": True}