Enable WITH_PYTHON on CI (#1689)

* Enable WITH_PYTHON on CI

* add python-dev

* use python3-dev instead of libpython3-dev

* use action to instlal python

* pybind now missing

* Fixed python build on linux

* warning

* try to install compatible pybind

* explicitly set where to find pybind
This commit is contained in:
matlabbe
2026-04-14 12:09:41 -07:00
committed by GitHub
parent a8fd7f043d
commit aa7546ec62
3 changed files with 17 additions and 5 deletions

View File

@@ -19,9 +19,11 @@ PythonInterface::PythonInterface()
guard_ = new pybind11::scoped_interpreter();
// Tell Python to look in this directory for DLLs
#ifdef _WIN32
std::string exe_dir = std::filesystem::current_path().string();
pybind11::module_ os = pybind11::module_::import("os");
os.attr("add_dll_directory")(exe_dir);
#endif
pybind11::module::import("threading");
release_ = new pybind11::gil_scoped_release();