mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 16:37:13 +00:00
Fix python.lib name
pybind11_add_module fails because FindPythonLibsNew.cmake try to link PythonXX.lib, but the first letter "p" should be lowercase.
This commit is contained in:
parent
8908552dfc
commit
3618807dca
@ -146,14 +146,14 @@ string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES "${PYTHON_SITE_PACKAGES}")
|
|||||||
|
|
||||||
if(CMAKE_HOST_WIN32 AND NOT (MINGW AND DEFINED ENV{MSYSTEM}))
|
if(CMAKE_HOST_WIN32 AND NOT (MINGW AND DEFINED ENV{MSYSTEM}))
|
||||||
set(PYTHON_LIBRARY
|
set(PYTHON_LIBRARY
|
||||||
"${PYTHON_PREFIX}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
|
"${PYTHON_PREFIX}/libs/python${PYTHON_LIBRARY_SUFFIX}.lib")
|
||||||
|
|
||||||
# when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the
|
# when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the
|
||||||
# original python installation. They may be found relative to PYTHON_INCLUDE_DIR.
|
# original python installation. They may be found relative to PYTHON_INCLUDE_DIR.
|
||||||
if(NOT EXISTS "${PYTHON_LIBRARY}")
|
if(NOT EXISTS "${PYTHON_LIBRARY}")
|
||||||
get_filename_component(_PYTHON_ROOT ${PYTHON_INCLUDE_DIR} DIRECTORY)
|
get_filename_component(_PYTHON_ROOT ${PYTHON_INCLUDE_DIR} DIRECTORY)
|
||||||
set(PYTHON_LIBRARY
|
set(PYTHON_LIBRARY
|
||||||
"${_PYTHON_ROOT}/libs/Python${PYTHON_LIBRARY_SUFFIX}.lib")
|
"${_PYTHON_ROOT}/libs/python${PYTHON_LIBRARY_SUFFIX}.lib")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# raise an error if the python libs are still not found.
|
# raise an error if the python libs are still not found.
|
||||||
|
Loading…
Reference in New Issue
Block a user