-
Notifications
You must be signed in to change notification settings - Fork 45
Support building with MSVC #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e19006e
to
0b4de27
Compare
The |
9e868e3
to
3ac4f3e
Compare
3ac4f3e
to
a2c04af
Compare
Fixes apache#7 The Python client cannot be built with MSVC. CMakeLists.txt: 1. Boost.Python cannot be found on Windows. The component of Boost cannot be `python3`. It should be a specific version like `python310`. Therefore, find all possible components from 3.10 to 3.7 until the first component is available. 2. For MSVC, link to `pulsarWithDeps.lib` when `LINK_STATIC` is `ON` and set the `MSVC_RUNTIME_LIBRARY` target property to `MultiThreaded`. 3. Change the suffix from `.so` to `.pyd` because Python on Windows recognizes `*.pyd` as the dynamic library. 4. Link to Python library with MSVC, otherwise the symbos cannot be found when linking `boost-python`. README: tell users how to build Python client on Windows. Add a workflow to build Python wheels of versions 3.7 to 3.10 on Windows and verify the build will succeed. With this PR, Windows users still need to put the related `boost_python*.dll` under the system path. In future, the `boost-python` dependency will be removed. See apache#24.
a2c04af
to
3475de8
Compare
@merlimat @Demogorgon314 @RobertIndie Now this Pr is ready to review, PTAL. I didn't add the packaging workflow. The only dependency is the boost python DLL. I think we only need to upload the .whl and the DLL as the artifacts. |
microsoft/vcpkg#27491 (comment) can link Boost.Python statically, but it requires other libraries are multi-threaded dynamically-linked. Since |
@BewareMyPower perhaps the DLL can be included in the wheel file, in similar way as we’re doing in Linux, where “auditwheel” command is fixing the wheel by adding the dependencies. |
Fixes #7
Motivation
The Python client cannot be built with MSVC.
Modifications
CMakeLists.txt:
cannot be
python3
. It should be a specific version likepython310
. Therefore, find all possible components from 3.10 to 3.7until the first component is available.
pulsarWithDeps.lib
whenLINK_STATIC
isON
andset the
MSVC_RUNTIME_LIBRARY
target property toMultiThreaded
..so
to.pyd
because Python on Windowsrecognizes
*.pyd
as the dynamic library.found when linking
boost-python
.README: tell users how to build Python client on Windows.
Add a workflow to build Python wheels of versions 3.7 to 3.10 on Windows
and verify the build will succeed.
NOTE
With this PR, Windows users still need to put the related
boost_python*.dll
under the system path. In future, theboost-python
dependency will be removed. See
#24.