]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added 'debug' flag to 'find_library_file()', and changed code to handle it.
authorGreg Ward <gward@python.net>
Fri, 4 Aug 2000 01:29:27 +0000 (01:29 +0000)
committerGreg Ward <gward@python.net>
Fri, 4 Aug 2000 01:29:27 +0000 (01:29 +0000)
Lib/distutils/msvccompiler.py

index a1dedb0e53f3e815f3727627cbeb483f9df47e45..eecbb620ed3a2815f79ec09ca2b559001b1eac5f 100644 (file)
@@ -474,13 +474,18 @@ class MSVCCompiler (CCompiler) :
         return self.library_filename (lib)
 
 
-    def find_library_file (self, dirs, lib):
-
+    def find_library_file (self, dirs, lib, debug=0):
+        # Prefer a debugging library if found (and requested), but deal
+        # with it if we don't have one.
+        if debug:
+            try_names = [lib + "_d", lib]
+        else:
+            try_names = [lib]
         for dir in dirs:
-            libfile = os.path.join (dir, self.library_filename (lib))
-            if os.path.exists (libfile):
-                return libfile
-
+            for name in try_names:
+                libfile = os.path.join(dir, self.library_filename (name))
+                if os.path.exists(libfile):
+                    return libfile
         else:
             # Oops, didn't find it in *any* of 'dirs'
             return None