Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/FindPythonLibsNew.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,16 @@ if(PYBIND11_PYTHONLIBS_OVERWRITE OR NOT DEFINED PYTHON_MODULE_DEBUG_POSTFIX)
endif()
if(PYBIND11_PYTHONLIBS_OVERWRITE OR NOT DEFINED PYTHON_MODULE_EXTENSION)
get_filename_component(PYTHON_MODULE_EXTENSION "${_PYTHON_MODULE_EXT_SUFFIX}" EXT)
if((NOT "$ENV{SETUPTOOLS_EXT_SUFFIX}" STREQUAL "") AND (NOT "$ENV{SETUPTOOLS_EXT_SUFFIX}"
STREQUAL "${PYTHON_MODULE_EXTENSION}"))
message(
AUTHOR_WARNING,
"SETUPTOOLS_EXT_SUFFIX is set to \"$ENV{SETUPTOOLS_EXT_SUFFIX}\", "
"but the auto-calculated Python extension suffix is \"${PYTHON_MODULE_EXTENSION}\". "
"This may cause problems when importing the Python extensions. "
"If you are using cross-compiling Python, you may need to "
"set PYTHON_MODULE_EXTENSION manually.")
endif()
endif()

# Make sure the Python has the same pointer-size as the chosen compiler
Expand Down
10 changes: 10 additions & 0 deletions tools/pybind11NewTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ if(NOT _PYBIND11_CROSSCOMPILING)
set(PYTHON_MODULE_EXTENSION
"${_PYTHON_MODULE_EXTENSION}"
CACHE INTERNAL "")
if((NOT "$ENV{SETUPTOOLS_EXT_SUFFIX}" STREQUAL "")
AND (NOT "$ENV{SETUPTOOLS_EXT_SUFFIX}" STREQUAL "${PYTHON_MODULE_EXTENSION}"))
message(
AUTHOR_WARNING,
"SETUPTOOLS_EXT_SUFFIX is set to \"$ENV{SETUPTOOLS_EXT_SUFFIX}\", "
"but the auto-calculated Python extension suffix is \"${PYTHON_MODULE_EXTENSION}\". "
"This may cause problems when importing the Python extensions. "
"If you are using cross-compiling Python, you may need to "
"set PYTHON_MODULE_EXTENSION manually.")
endif()
endif()
endif()
else()
Expand Down
Loading