File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,16 @@ if(PYBIND11_PYTHONLIBS_OVERWRITE OR NOT DEFINED PYTHON_MODULE_DEBUG_POSTFIX)
200200endif ()
201201if (PYBIND11_PYTHONLIBS_OVERWRITE OR NOT DEFINED PYTHON_MODULE_EXTENSION)
202202 get_filename_component (PYTHON_MODULE_EXTENSION "${_PYTHON_MODULE_EXT_SUFFIX} " EXT )
203+ if ((NOT "$ENV{SETUPTOOLS_EXT_SUFFIX} " STREQUAL "" ) AND (NOT "$ENV{SETUPTOOLS_EXT_SUFFIX} "
204+ STREQUAL "${PYTHON_MODULE_EXTENSION} " ))
205+ message (
206+ AUTHOR_WARNING,
207+ "SETUPTOOLS_EXT_SUFFIX is set to \" $ENV{SETUPTOOLS_EXT_SUFFIX} \" , "
208+ "but the auto-calculated Python extension suffix is \" ${PYTHON_MODULE_EXTENSION} \" . "
209+ "This may cause problems when importing the Python extensions. "
210+ "If you are using cross-compiling Python, you may need to "
211+ "set PYTHON_MODULE_EXTENSION manually." )
212+ endif ()
203213endif ()
204214
205215# Make sure the Python has the same pointer-size as the chosen compiler
Original file line number Diff line number Diff line change @@ -171,6 +171,16 @@ if(NOT _PYBIND11_CROSSCOMPILING)
171171 set (PYTHON_MODULE_EXTENSION
172172 "${_PYTHON_MODULE_EXTENSION} "
173173 CACHE INTERNAL "" )
174+ if ((NOT "$ENV{SETUPTOOLS_EXT_SUFFIX} " STREQUAL "" )
175+ AND (NOT "$ENV{SETUPTOOLS_EXT_SUFFIX} " STREQUAL "${PYTHON_MODULE_EXTENSION} " ))
176+ message (
177+ AUTHOR_WARNING,
178+ "SETUPTOOLS_EXT_SUFFIX is set to \" $ENV{SETUPTOOLS_EXT_SUFFIX} \" , "
179+ "but the auto-calculated Python extension suffix is \" ${PYTHON_MODULE_EXTENSION} \" . "
180+ "This may cause problems when importing the Python extensions. "
181+ "If you are using cross-compiling Python, you may need to "
182+ "set PYTHON_MODULE_EXTENSION manually." )
183+ endif ()
174184 endif ()
175185 endif ()
176186else ()
You can’t perform that action at this time.
0 commit comments