Add a new definition to Extension objects: depends.

depends is a list of files that the target depends, but aren't direct
sources of the target.  think .h files.
This commit is contained in:
Jeremy Hylton 2002-06-12 20:08:56 +00:00
parent aa6a664bbb
commit 09e532bcec
2 changed files with 6 additions and 1 deletions

View File

@ -422,7 +422,8 @@ class build_ext (Command):
ext_filename = os.path.join(self.build_lib, ext_filename = os.path.join(self.build_lib,
self.get_ext_filename(fullname)) self.get_ext_filename(fullname))
if not (self.force or newer_group(sources, ext_filename, 'newer')): depends = sources + ext.depends
if not (self.force or newer_group(depends, ext_filename, 'newer')):
log.debug("skipping '%s' extension (up-to-date)", ext.name) log.debug("skipping '%s' extension (up-to-date)", ext.name)
return return
else: else:

View File

@ -73,6 +73,8 @@ class Extension:
used on all platforms, and not generally necessary for Python used on all platforms, and not generally necessary for Python
extensions, which typically export exactly one symbol: "init" + extensions, which typically export exactly one symbol: "init" +
extension_name. extension_name.
depends : [string]
list of files that the extension depends on
""" """
def __init__ (self, name, sources, def __init__ (self, name, sources,
@ -86,6 +88,7 @@ class Extension:
extra_compile_args=None, extra_compile_args=None,
extra_link_args=None, extra_link_args=None,
export_symbols=None, export_symbols=None,
depends=None,
): ):
assert type(name) is StringType, "'name' must be a string" assert type(name) is StringType, "'name' must be a string"
@ -105,6 +108,7 @@ class Extension:
self.extra_compile_args = extra_compile_args or [] self.extra_compile_args = extra_compile_args or []
self.extra_link_args = extra_link_args or [] self.extra_link_args = extra_link_args or []
self.export_symbols = export_symbols or [] self.export_symbols = export_symbols or []
self.depends = depends or []
# class Extension # class Extension