diff --git a/share/openPMD/thirdParty/pybind11/include/pybind11/pybind11.h b/share/openPMD/thirdParty/pybind11/include/pybind11/pybind11.h index 3bffbb28d2..f284fb7f9f 100644 --- a/share/openPMD/thirdParty/pybind11/include/pybind11/pybind11.h +++ b/share/openPMD/thirdParty/pybind11/include/pybind11/pybind11.h @@ -10,6 +10,23 @@ #pragma once +/* https://github.com/microsoft/onnxruntime/issues/9735#issuecomment-970718821 + * The following block patches MSVC debug builds: + * Include Python header, disable linking to pythonX_d.lib on Windows in debug mode. + */ +#if defined(_MSC_VER) +# if (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 4) +# define HAVE_ROUND 1 +# endif +# include +# pragma warning(push) +# pragma warning(disable : 4510 4610 4512 4005) +# if defined(_DEBUG) && !defined(Py_DEBUG) +# define PYBIND11_DEBUG_MARKER +# undef _DEBUG +# endif +#endif + #if defined(__INTEL_COMPILER) # pragma warning push # pragma warning disable 68 // integer conversion resulted in a change of sign