File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,13 @@ function(pybind11_add_module target_name)
135
135
PRIVATE ${pybind11_INCLUDE_DIR} # from pybind11Config
136
136
PRIVATE ${PYTHON_INCLUDE_DIRS} )
137
137
138
+ # Python debug libraries expose slightly different objects
139
+ # https://docs.python.org/3.6/c-api/intro.html#debugging-builds
140
+ # https://stackoverflow.com/questions/39161202/how-to-work-around-missing-pymodule-create2-in-amd64-win-python35-d-lib
141
+ if (PYTHON_IS_DEBUG )
142
+ target_compile_definitions (${target_name} PRIVATE Py_DEBUG )
143
+ endif ()
144
+
138
145
# The prefix and extension are provided by FindPythonLibsNew.cmake
139
146
set_target_properties (${target_name} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX} " )
140
147
set_target_properties (${target_name} PROPERTIES SUFFIX "${PYTHON_MODULE_EXTENSION} " )
You can’t perform that action at this time.
0 commit comments