Replies: 1 comment
-
This burden is also discussed in issue #3403 As of today, I "control" the python runtime I link with by including pybind11 in one place (my pch) and "debug proof it with: #ifdef _DEBUG
#undef _DEBUG
#undef Py_DEBUG // this is unfortunately required to prevent undefines in python (Py_RefTotal and another)
#define _DEBUG_RESTORE
#endif
#include <pybind11/pybind11.h>
#include <pybind11/whatever_you_also_need.h>
#ifdef _DEBUG_RESTORE
#define _DEBUG
#undef _DEBUG_RESTORE
#endif This is "annoying" but "somewhat" makes sense. and "manually" add the release runtime to my (previously declared with pybind11_add_module) module: target_link_libraries(MyModule
PRIVATE
${_Python_LIBRARY_RELEASE}
) Which I feel is a really bad thing to do... :-) HTH anyone with similar issues. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Been using pybind11 on Windows with vcpkg, it has been a smooth and happy ride so far :-)
(the docs are great, the updates regular etc..., I love using pybind11)
There has been one hurdle that we 'seem' to have gone past is Python version and files detection that has been going in different directions. With the latest update, I look forward to a nice and smooth [New FindPython mode].(https://pybind11.readthedocs.io/en/stable/cmake/index.html#new-findpython-mode)
However, I feel there have been hacks and tricks that have been used to switch from "pythonxx_d.lib" to "pythonxx.lib" and for naming modules mymodule_d.pyd or mymodule.pyd.
With the "New FindPython", there could be an opportunity to have this configuration cleaned, cleared and documented.
There are many contexts where debug builds don't require or need pythonxx_d.lib to be properly debugger and many situation where they just add complexity where it is not needed (jupyter notebooks).
I would be happy to help test and document those "guidelines" but I honestly don't know how this "should" be done properly:
Thank you for pybind11!
Beta Was this translation helpful? Give feedback.
All reactions