MCPcopy Create free account
hub / github.com/numpy/numpy / _find_lib

Method _find_lib

numpy/distutils/system_info.py:1017–1040  ·  view source on GitHub ↗
(self, lib_dir, lib, exts)

Source from the content-addressed store, hash-verified

1015 return info
1016
1017 def _find_lib(self, lib_dir, lib, exts):
1018 assert is_string(lib_dir)
1019 # under windows first try without 'lib' prefix
1020 if sys.platform == 'win32':
1021 lib_prefixes = ['', 'lib']
1022 else:
1023 lib_prefixes = ['lib']
1024 # for each library name, see if we can find a file for it.
1025 for ext in exts:
1026 for prefix in lib_prefixes:
1027 p = self.combine_paths(lib_dir, prefix + lib + ext)
1028 if p:
1029 break
1030 if p:
1031 assert len(p) == 1
1032 # ??? splitext on p[0] would do this for cygwin
1033 # doesn't seem correct
1034 if ext == '.dll.a':
1035 lib += '.dll'
1036 if ext == '.lib':
1037 lib = prefix + lib
1038 return lib
1039
1040 return False
1041
1042 def _find_libs(self, lib_dirs, libs, exts):
1043 # make sure we preserve the order of libs, as it can be important

Callers 1

_find_libsMethod · 0.95

Calls 2

combine_pathsMethod · 0.95
is_stringFunction · 0.90

Tested by

no test coverage detected