summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2003-12-05 20:12:23 +0000
committerThomas Heller <theller@ctypes.org>2003-12-05 20:12:23 +0000
commit9436a75e4dfdae297c20be36ab3e65c5ab7ab1a4 (patch)
treea3feec7aa4545248f9fec999d529c56db86f13eb
parentf96dd83bb49a4232ac01725b5b0c40d392b7b1eb (diff)
downloadcpython-git-9436a75e4dfdae297c20be36ab3e65c5ab7ab1a4.tar.gz
Compile the files in the same order they are passed to the compiler.
Use case: Sometimes 'compiling' source files (with SWIG, for example) creates additionl files which included by later sources. The win32all setup script requires this. There is no SF item for this, but it was discussed on distutils-sig: http://mail.python.org/pipermail/distutils-sig/2003-November/003514.html
-rw-r--r--Lib/distutils/bcppcompiler.py6
-rw-r--r--Lib/distutils/ccompiler.py6
-rw-r--r--Lib/distutils/msvccompiler.py6
3 files changed, 15 insertions, 3 deletions
diff --git a/Lib/distutils/bcppcompiler.py b/Lib/distutils/bcppcompiler.py
index cfbe04ac01..b0360a248e 100644
--- a/Lib/distutils/bcppcompiler.py
+++ b/Lib/distutils/bcppcompiler.py
@@ -96,7 +96,11 @@ class BCPPCompiler(CCompiler) :
else:
compile_opts.extend (self.compile_options)
- for obj, (src, ext) in build.items():
+ for obj in objects:
+ try:
+ src, ext = build[obj]
+ except KeyError:
+ continue
# XXX why do the normpath here?
src = os.path.normpath(src)
obj = os.path.normpath(obj)
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py
index 751ec0694b..ebd93c27eb 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -691,7 +691,11 @@ class CCompiler:
depends, extra_postargs)
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
- for obj, (src, ext) in build.items():
+ for obj in objects:
+ try:
+ src, ext = build[obj]
+ except KeyError:
+ continue
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
# Return *all* object filenames, not just the ones we just built.
diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py
index 27fb658b5b..1441ea04c3 100644
--- a/Lib/distutils/msvccompiler.py
+++ b/Lib/distutils/msvccompiler.py
@@ -291,7 +291,11 @@ class MSVCCompiler (CCompiler) :
else:
compile_opts.extend(self.compile_options)
- for obj, (src, ext) in build.items():
+ for obj in objects:
+ try:
+ src, ext = build[obj]
+ except KeyError:
+ continue
if debug:
# pass the full pathname to MSVC in debug mode,
# this allows the debugger to find the source file