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


Python ccompiler.gen_preprocess_options方法代碼示例

本文整理匯總了Python中distutils.ccompiler.gen_preprocess_options方法的典型用法代碼示例。如果您正苦於以下問題:Python ccompiler.gen_preprocess_options方法的具體用法?Python ccompiler.gen_preprocess_options怎麽用?Python ccompiler.gen_preprocess_options使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.ccompiler的用法示例。


在下文中一共展示了ccompiler.gen_preprocess_options方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: preprocess

# 需要導入模塊: from distutils import ccompiler [as 別名]
# 或者: from distutils.ccompiler import gen_preprocess_options [as 別名]
def preprocess (self,
                    source,
                    output_file=None,
                    macros=None,
                    include_dirs=None,
                    extra_preargs=None,
                    extra_postargs=None):

        (_, macros, include_dirs) = \
            self._fix_compile_args(None, macros, include_dirs)
        pp_opts = gen_preprocess_options(macros, include_dirs)
        pp_args = ['cpp32.exe'] + pp_opts
        if output_file is not None:
            pp_args.append('-o' + output_file)
        if extra_preargs:
            pp_args[:0] = extra_preargs
        if extra_postargs:
            pp_args.extend(extra_postargs)
        pp_args.append(source)

        # We need to preprocess: either we're being forced to, or the
        # source file is newer than the target (or the target doesn't
        # exist).
        if self.force or output_file is None or newer(source, output_file):
            if output_file:
                self.mkpath(os.path.dirname(output_file))
            try:
                self.spawn(pp_args)
            except DistutilsExecError, msg:
                print msg
                raise CompileError, msg

    # preprocess() 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:35,代碼來源:bcppcompiler.py

示例2: gen_preprocess_options

# 需要導入模塊: from distutils import ccompiler [as 別名]
# 或者: from distutils.ccompiler import gen_preprocess_options [as 別名]
def gen_preprocess_options (macros, include_dirs):
    include_dirs = quote_args(include_dirs)
    return _distutils_gen_preprocess_options(macros, include_dirs) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:5,代碼來源:ccompiler.py


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