added check for libpython_version#m.dylib present in some virtual environments (#687)

This commit is contained in:
Ian Philips 2017-07-06 11:02:47 -06:00 committed by Davis E. King
parent 26524fe7a1
commit 8de627e105

View File

@ -526,7 +526,11 @@ class build(_build):
# this checks the sysconfig and will correctly pick up a brewed python lib
# e.g. in /usr/local/Cellar
py_ver = get_python_version()
# check: in some virtual environments the libpython has the form "libpython_#m.dylib
py_lib = os.path.join(get_config_var('LIBDIR'), 'libpython'+py_ver+'.dylib')
if not os.path.isfile(py_lib):
py_lib = os.path.join(get_config_var('LIBDIR'), 'libpython'+py_ver+'m.dylib')
cmake_extra_arch += ['-DPYTHON_LIBRARY={lib}'.format(lib=py_lib)]
if sys.platform == "win32":