Description
Hello everyone,
First, thank you everyone for this great tool !
Issue description
Current system:
- Windows 10
- MinGW
- conda 4.8.1 installed on windows
- python version 3.7.4 (the one in conda)
- cmake 3.14.0 installed on windows
- compiler MSVC 14.24.28314
After PR #2053 was merged, our building pipelines on windows started failing. The output message error is fatal error LNK1181: cannot open input file 'python37.lib
.
After tracking the problem, I found out that PYTHON_LIBRARY
in file tools/FindPythonLibsNew.cmake
was not set to the correct path.
- Before PR Fix compilation with MinGW only #2053
PYTHON_LIBRARY
=C:/Users/user/Anaconda3/libs/python37.lib
- After PR Fix compilation with MinGW only #2053
PYTHON_LIBRARY
=python37.lib
Debugging each step of the previous file resulted that:
PYTHON_LIBDIR
is empty- After the patch, it tries to look in a Linux location for the library
PYTHON_LIBRARY
is set topython37.lib
I found a solution changing some lines in tools/FindPythonLibsNew.cmake
, without changing the behaviour for Linux or Mac.
I would like to know if you'll be interested for a PR, if yes the only thing is I don't have many more windows system to test on it. To I don't know if other Windows user with their build system could test ?
Or maybe do you have any other suggestion that could help us of course :) ?
Reproducible example code
- windows system
- install mingw
- install conda for windows
- import a C++ project using cmake for building process, and of course pybind
In the CmakeLists.txt
file, we use add_subdirectory()
to indicate where the folder of pybind11 is located.
Expected error: fatal error LNK1181: cannot open input file 'python37.lib
Let me know if you have any questions/suggestion.
Cheers,
Julián