Skip to content

Commit

Permalink
add missing iphlapi for bundled libzmq on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Mar 21, 2018
1 parent 1af5538 commit f739bbb
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,14 @@ def bundle_libzmq_extension(self):
sources=sources,
include_dirs=includes,
)

# register the extension:
self.distribution.ext_modules.insert(0, libzmq)

# use tweetnacl to provide CURVE support
libzmq.define_macros.append(('ZMQ_HAVE_CURVE', 1))
libzmq.define_macros.append(('ZMQ_USE_TWEETNACL', 1))

# select polling subsystem based on platform
if sys.platform == 'darwin' or 'bsd' in sys.platform:
libzmq.define_macros.append(('ZMQ_USE_KQUEUE', 1))
Expand All @@ -547,13 +547,13 @@ def bundle_libzmq_extension(self):
else:
# this may not be sufficiently precise
libzmq.define_macros.append(('ZMQ_USE_POLL', 1))

if sys.platform.startswith('win'):
# include defines from zeromq msvc project:
libzmq.define_macros.append(('FD_SETSIZE', 16384))
libzmq.define_macros.append(('DLL_EXPORT', 1))
libzmq.define_macros.append(('_CRT_SECURE_NO_WARNINGS', 1))

# When compiling the C++ code inside of libzmq itself, we want to
# avoid "warning C4530: C++ exception handler used, but unwind
# semantics are not enabled. Specify /EHsc".
Expand All @@ -563,8 +563,8 @@ def bundle_libzmq_extension(self):
libzmq.define_macros.append(('ZMQ_HAVE_MINGW32', 1))

# And things like sockets come from libraries that must be named.
libzmq.libraries.extend(['rpcrt4', 'ws2_32', 'advapi32'])
libzmq.libraries.extend(['rpcrt4', 'ws2_32', 'advapi32', 'iphlpapi'])

# bundle MSCVP redist
if self.config['bundle_msvcp']:
cc = new_compiler(compiler=self.compiler_type)
Expand Down Expand Up @@ -602,29 +602,28 @@ def bundle_libzmq_extension(self):
libzmq.libraries.append('rt')
else:
info("ok")

if pypy:
# seem to need explicit libstdc++ on linux + pypy
# not sure why
libzmq.libraries.append("stdc++")

# copy the header files to the source tree.
bundledincludedir = pjoin('zmq', 'include')
if not os.path.exists(bundledincludedir):
os.makedirs(bundledincludedir)
if not os.path.exists(pjoin(self.build_lib, bundledincludedir)):
os.makedirs(pjoin(self.build_lib, bundledincludedir))

for header in glob(pjoin(bundledir, 'zeromq', 'include', '*.h')):
shutil.copyfile(header, pjoin(bundledincludedir, basename(header)))
shutil.copyfile(header, pjoin(self.build_lib, bundledincludedir, basename(header)))

# update other extensions, with bundled settings
self.config['libzmq_extension'] = True
self.init_settings_from_config()
self.save_config('config', self.config)



def fallback_on_bundled(self):
"""Couldn't build, fallback after waiting a while"""

Expand Down

0 comments on commit f739bbb

Please sign in to comment.