diff options
author | Greg Ward <gward@python.net> | 2000-08-04 01:29:27 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-08-04 01:29:27 (GMT) |
commit | d142564821b8427e8839742ef0813f776fb7ba78 (patch) | |
tree | 5884399f765ec04a9d70fa0c28242f4a97413a15 | |
parent | e5e6015e5a888b62b65e049783ed623678e51240 (diff) | |
download | cpython-d142564821b8427e8839742ef0813f776fb7ba78.zip cpython-d142564821b8427e8839742ef0813f776fb7ba78.tar.gz cpython-d142564821b8427e8839742ef0813f776fb7ba78.tar.bz2 |
Added 'debug' flag to 'find_library_file()', and changed code to handle it.
-rw-r--r-- | Lib/distutils/msvccompiler.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py index a1dedb0..eecbb62 100644 --- a/Lib/distutils/msvccompiler.py +++ b/Lib/distutils/msvccompiler.py @@ -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 |