diff options
Diffstat (limited to 'mesonbuild/dependencies/python.py')
| -rw-r--r-- | mesonbuild/dependencies/python.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py index 342d94e72..6620eff20 100644 --- a/mesonbuild/dependencies/python.py +++ b/mesonbuild/dependencies/python.py @@ -61,6 +61,17 @@ class Pybind11ConfigToolDependency(ConfigToolDependency): self.compile_args = self.get_config_value(['--includes'], 'compile_args') +class NumPyConfigToolDependency(ConfigToolDependency): + + tools = ['numpy-config'] + + def __init__(self, name: str, environment: Environment, kwargs: T.Dict[str, T.Any]): + super().__init__(name, environment, kwargs) + if not self.is_found: + return + self.compile_args = self.get_config_value(['--cflags'], 'compile_args') + + class BasicPythonExternalProgram(ExternalProgram): def __init__(self, name: str, command: T.Optional[T.List[str]] = None, ext_prog: T.Optional[ExternalProgram] = None): @@ -412,3 +423,9 @@ packages['pybind11'] = pybind11_factory = DependencyFactory( [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.CMAKE], configtool_class=Pybind11ConfigToolDependency, ) + +packages['numpy'] = numpy_factory = DependencyFactory( + 'numpy', + [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL], + configtool_class=NumPyConfigToolDependency, +) |
