本文整理汇总了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()
示例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)