]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Compile the files in the same order they are passed to the compiler.
authorThomas Heller <theller@ctypes.org>
Fri, 5 Dec 2003 20:12:23 +0000 (20:12 +0000)
committerThomas Heller <theller@ctypes.org>
Fri, 5 Dec 2003 20:12:23 +0000 (20:12 +0000)
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

Lib/distutils/bcppcompiler.py
Lib/distutils/ccompiler.py
Lib/distutils/msvccompiler.py

index cfbe04ac01ec851eb360a7ccf43a8acdba71866a..b0360a248eec0c6fba3274df96a1943c65f8f913 100644 (file)
@@ -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)
index 751ec0694bcdb62bc9d9d990b56a46ccb51ac447..ebd93c27eb09c1f530e81cf1a57923cdd0397b6b 100644 (file)
@@ -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.
index 27fb658b5bb9b8373832663d4882019460e18143..1441ea04c3b22788ee47e277f43730494ad0b54d 100644 (file)
@@ -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