From 09e532bcecfb891b8aee0f9730fcbfccda2f8767 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Wed, 12 Jun 2002 20:08:56 +0000 Subject: 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. --- Lib/distutils/command/build_ext.py | 3 ++- Lib/distutils/extension.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index d8f3dc8..21dd0dc 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -422,7 +422,8 @@ class build_ext (Command): ext_filename = os.path.join(self.build_lib, 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) return else: diff --git a/Lib/distutils/extension.py b/Lib/distutils/extension.py index 3737712..d73bb08 100644 --- a/Lib/distutils/extension.py +++ b/Lib/distutils/extension.py @@ -73,6 +73,8 @@ class Extension: used on all platforms, and not generally necessary for Python extensions, which typically export exactly one symbol: "init" + extension_name. + depends : [string] + list of files that the extension depends on """ def __init__ (self, name, sources, @@ -86,6 +88,7 @@ class Extension: extra_compile_args=None, extra_link_args=None, export_symbols=None, + depends=None, ): 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_link_args = extra_link_args or [] self.export_symbols = export_symbols or [] + self.depends = depends or [] # class Extension -- cgit v0.12