aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/python.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-28python dependency: avoid redefinition warnings for MS_WIN64Eli Schwartz1-1/+1
pyconfig.h defines it in limited cases, but as empty, rather than as "1" which is what command-line defines generally do. Explicitly define it as a compatible definition so the compiler does not log a warning that the value has changed. Fixes #11592
2023-03-09dependencies: add pybind11 custom factoryEli Schwartz1-0/+23
This works with pkg-config and cmake without any special support. The custom factory adds further support for config-tool, via `pybind11-config`. This is useful because the config-tool will work out of the box when pybind11 is installed, but the pkg-config and cmake files are shoved into python's site-packages, which is an unfortunate distribution model and makes it impossible to use in an out of the box manner. It's possible to manually set up the PKG_CONFIG_PATH to detect it anyway, but in case that does not happen, having the config-tool fallback is extremely useful.
2023-02-27python dependency: Fix typo in placeholder stringDaniele Nicolodi1-1/+1
2023-02-22python dependency: handle broken pylong on many more versions of pythonEli Schwartz1-1/+2
This workaround was never exclusive to python2, and in fact only just got fixed in the upcoming python 3.12 release. Extend the version comparison to cover all those other cases.
2023-02-22python dependency: fix embed handling for system dependencyEli Schwartz1-16/+20
Only search for and provide linkage to libpython, if the dependency expects to be linked to it. Fixes overlinking on Linux / macOS when pkg-config isn't installed and the sysconfig lookup is used instead. This was correctly handled for pkg-config rather than deferring it until use, since commit bf832743441a1171518d7a436164c989be679410 -- but that handling neglected to cover sysconfig dependencies. And sysconfig would always try to link to libpython, it just respected the dependency configuration barely enough to allow falling back to "don't link" if both link_libpython=False and the library wasn't found.
2023-02-22python dependency: verify that the python header is installed for sysconfigEli Schwartz1-0/+3
We may or may not care that the library can be found. If link_libpython is false, we allow it to be missing and still find the dependency.
2023-02-22python dependency: simplify compile args handlingEli Schwartz1-19/+13
We can set it once instead of tangling it inside the guts of the overly specialized library lookups. It is mostly identical anyway.
2023-02-22merge the python dependency from the python module into dependenciesEli Schwartz1-50/+144
We have two copies of this code, and the python module one is vastly superior, not just because it allows choosing which python executable to base itself on. Unify this. Fixes various issues including non-Windows support for sysconfig, and pypy edge cases.
2023-02-22partial migration of the python module dependency into dependenciesEli Schwartz1-1/+60
In preparation for wholly merging the dependency handling from the python module into dependencies.*, move the unique class definitions from there into their new home in dependencies.python, which is semantically convenient.
2023-02-22python module/dependency: move the specialized external programEli Schwartz1-2/+79
In preparation for handling more work inside dependencies.*, we need to be able to run a PythonExternalProgram from the python dependency. Move most of the definition -- but only the parts that have no interest in a ModuleState -- and subclass a bit of sanity checking that we need to handle specially when used in the module.
2023-02-22dependencies: refactor python3 into its own fileEli Schwartz1-0/+141