42 lines
1.3 KiB
Meson
42 lines
1.3 KiB
Meson
python_extension = []
|
|
python_extension_dir = ''
|
|
|
|
if get_option('build_python')
|
|
if is_wasm
|
|
error('The native CPython extension cannot be built for Emscripten. Disable build_python for the WASM profile.')
|
|
endif
|
|
nanobind_dep = dependency('nanobind', version: '>=2.15.0', fallback: 'nanobind')
|
|
extension_rpath_args = []
|
|
if host_machine.system() == 'darwin'
|
|
extension_rpath_args = [
|
|
'-Wl,-rpath,@loader_path/lib',
|
|
'-Wl,-rpath,@loader_path/lib64',
|
|
]
|
|
elif not is_windows
|
|
extension_rpath_args = [
|
|
'-Wl,-rpath,$ORIGIN/lib',
|
|
'-Wl,-rpath,$ORIGIN/lib64',
|
|
]
|
|
endif
|
|
python_extension = python_build.extension_module(
|
|
'_core',
|
|
'../src/python/bindings.cpp',
|
|
dependencies: [nanobind_dep, mfem_dep, template_include_dep],
|
|
override_options: ['cpp_std=' + mfem_consumer_cpp_std],
|
|
link_args: extension_rpath_args,
|
|
build_rpath: '',
|
|
install_rpath: '',
|
|
install: true,
|
|
install_tag: 'python-runtime',
|
|
subdir: 'meson_mfem_template',
|
|
)
|
|
python_extension_dir = meson.current_build_dir()
|
|
python_build.install_sources(
|
|
'../python/meson_mfem_template/__init__.py',
|
|
'../python/meson_mfem_template/_core.pyi',
|
|
'../python/meson_mfem_template/py.typed',
|
|
subdir: 'meson_mfem_template',
|
|
install_tag: 'python-runtime',
|
|
)
|
|
endif
|