Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@
libraries.append(str('nanoconfig'))
define_macros = [('WITH_NANOCONFIG', '1')]

class custom_build_ext(build_ext):
"""
Add appropriate rpath linker flags (necessary on mac)
"""
def finalize_options(self):
super().finalize_options()
# Special treatment of rpath in case of OSX, to work around python
# distutils bug 36353. This constructs proper rpath arguments for clang.
# See https://bugs.python.org/issue36353
# Workaround from https://github.com/python/cpython/pull/12418
if sys.platform[:6] == "darwin":
for path in self.rpath:
for ext in self.extensions:
ext.extra_link_args.append("-Wl,-rpath," + path)
self.rpath[:] = []

cpy_extension = Extension(str('_nanomsg_cpy'),
define_macros=define_macros,
sources=[str('_nanomsg_cpy/wrapper.c')],
Expand All @@ -56,6 +72,9 @@


setup(
cmdclass = {
'build_ext': custom_build_ext
},
name='nanomsg',
version=__version__,
packages=[str('nanomsg'), str('_nanomsg_ctypes'), str('nanomsg_wrappers')],
Expand Down