Commit 5c4af0ce authored by Michael Davidsaver's avatar Michael Davidsaver

info file export soname and fix for windows w/ py < 3.8

parent 42641e32
......@@ -412,17 +412,37 @@ class build_dso(dso2libmixin, Command):
file.write(
textwrap.dedent(
"""
import os.path
import sys
dir = os.path.dirname(__file__)
if sys.platform == 'win32':
os.add_dll_directory(dir)
# generated by setuptools_dso
import sys, os
# on windows, extend DLL search path to include
# the directory containing this file
def fixpath():
libdir = os.path.dirname(__file__)
if hasattr(os, 'add_dll_directory'): # py >= 3.8
os.add_dll_directory(libdir)
elif sys.platform == "win32":
path = os.environ.get('PATH', '').split(os.pathsep)
path.append(libdir)
os.environ['PATH'] = os.pathsep.join(path)
fixpath()
del fixpath
dsoname = {dsoname!r}
libname = {libname!r}
soname = {soname!r}
dir = os.path.dirname(__file__)
filename = os.path.join(dir, libname)
__all__ = ("dsoname", "libname", "filename")
sofilename = os.path.join(dir, soname)
del dir
__all__ = ("dsoname", "libname", "soname", "filename", "sofilename")
"""
).format(dsoname=dso.name, libname=self._name2libname(dso))
).format(dsoname=dso.name,
libname=self._name2libname(dso),
soname=self._name2libname(dso, so=True))
)
if self.inplace:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment