mirror of
https://github.com/python/cpython.git
synced 2025-11-13 15:40:05 +00:00
Added 'debug' flag to 'find_library_file()', and changed code to handle it.
This commit is contained in:
parent
e5e6015e5a
commit
d142564821
1 changed files with 11 additions and 6 deletions
|
|
@ -474,13 +474,18 @@ class MSVCCompiler (CCompiler) :
|
||||||
return self.library_filename (lib)
|
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:
|
for dir in dirs:
|
||||||
libfile = os.path.join (dir, self.library_filename (lib))
|
for name in try_names:
|
||||||
if os.path.exists (libfile):
|
libfile = os.path.join(dir, self.library_filename (name))
|
||||||
|
if os.path.exists(libfile):
|
||||||
return libfile
|
return libfile
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Oops, didn't find it in *any* of 'dirs'
|
# Oops, didn't find it in *any* of 'dirs'
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue