當前位置: 首頁>>代碼示例>>Python>>正文


Python PrepareClangFlags.remove方法代碼示例

本文整理匯總了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
  }
開發者ID:mtzstngl,項目名稱:RSA_Encryption,代碼行數:28,代碼來源:.ycm_extra_conf.py

示例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}
開發者ID:harunpehlivan,項目名稱:StreamHub-iOS-SDK,代碼行數:31,代碼來源:.ycm_extra_conf.py


注:本文中的clang_helpers.PrepareClangFlags.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。