Skip to content

Commit

Permalink
Merge pull request #18058 from eli-schwartz/pybind11-dep
Browse files Browse the repository at this point in the history
BLD: use meson-native dependency lookup for pybind11

[skip ci]
  • Loading branch information
rgommers committed Feb 27, 2023
2 parents a2c0b65 + 26edc5c commit edd8fd2
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions scipy/meson.build
Expand Up @@ -80,22 +80,27 @@ npymath_lib = cc.find_library('npymath', dirs: npymath_path)
npyrandom_lib = cc.find_library('npyrandom', dirs: npyrandom_path)

# pybind11 include directory - needed in several submodules
incdir_pybind11 = run_command(py3,
[
'-c',
'''from os.path import relpath
#
# in meson 1.1.0, this will find the pyproject.toml build-requires version
pybind11_dep = dependency('pybind11', version: '>=2.10.0', required: false, allow_fallback: true)
if not pybind11_dep.found()
incdir_pybind11 = run_command(py3,
[
'-c',
'''from os.path import relpath
import pybind11
try:
incdir = relpath(pybind11.get_include())
except Exception:
incdir = pybind11.get_include()
print(incdir)
'''
],
check: true
).stdout().strip()
'''
],
check: true
).stdout().strip()

pybind11_dep = declare_dependency(include_directories: incdir_pybind11)
pybind11_dep = declare_dependency(include_directories: incdir_pybind11)
endif

# Pythran include directory and build flags
if use_pythran
Expand Down

0 comments on commit edd8fd2

Please sign in to comment.