本文整理汇总了Python中distutils.ccompiler.CCompiler._setup_compile方法的典型用法代码示例。如果您正苦于以下问题:Python CCompiler._setup_compile方法的具体用法?Python CCompiler._setup_compile怎么用?Python CCompiler._setup_compile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.ccompiler.CCompiler
的用法示例。
在下文中一共展示了CCompiler._setup_compile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_compile
# 需要导入模块: from distutils.ccompiler import CCompiler [as 别名]
# 或者: from distutils.ccompiler.CCompiler import _setup_compile [as 别名]
def _setup_compile(self, outdir, macros, incdirs, sources, depends,
extra_postargs):
macros, objects, extra_postargs, pp_opts, build = \
CCompiler._setup_compile(self, outdir, macros, incdirs, [],
depends, extra_postargs)
if incdirs is None:
incdirs = self.include_dirs
else:
incdirs = list(incdirs) + (self.include_dirs or [])
if depends is None:
depends = set()
else:
depends = set(depends)
# Get the list of expected output files
objects = self.object_filenames(sources,
strip_dir=0,
output_dir=outdir)
# Do dependency checking
skip_source = set()
if self.force:
# rebuild everything
pass
else:
for src, obj in izip(sources, objects):
deps = _find_depends(src, incdirs, depends)
deps.add(src)
if not newer_group(deps, obj):
skip_source.add(src)
build = {}
for src, obj in izip(sources, objects):
self.mkpath(os.path.dirname(obj))
if src in skip_source:
log.debug("skipping %s (%s up-to-date)", src, obj)
else:
build[obj] = src, os.path.splitext(src)[1]
return macros, objects, extra_postargs, pp_opts, build