-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
64 lines (56 loc) · 1.43 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
project(
'odrpack',
['cpp'],
version : '0.2.0',
meson_version: '>=1.5.0',
default_options: [
'buildtype=release',
'b_ndebug=if-release',
'cpp_std=c++17'
],
)
# compilers
add_languages('fortran', native: false)
# python
python = import('python').find_installation(pure: false)
python_dep = python.dependency()
# nanobind (from subprojects)
nanobind_dep = dependency('nanobind', static: true)
# odrpack (from subprojects)
odrpack_dep = dependency('odrpack95', static: true)
# build extension module
nanobind_ext = python.extension_module(
'__odrpack',
'src/odrpack/__odrpack.py.cpp',
dependencies : [python_dep, nanobind_dep, odrpack_dep],
install: true,
# limited_api: '3.12',
subdir: 'odrpack'
)
python.install_sources(
[
'src/odrpack/__init__.py',
'src/odrpack/driver.py',
'src/odrpack/exceptions.py',
'src/odrpack/result.py',
'src/odrpack/py.typed',
'src/odrpack/__odrpack.pyi',
],
subdir: 'odrpack'
)
# Generate stubs
# python -m nanobind.stubgen -m odrpack.__odrpack --output-dir "src/odrpack"
# stubgen_command = [
# python,
# '-m', 'nanobind.stubgen',
# 'odrpack.__odrpack',
# '--output-dir', 'src/odrpack'
# ]
# stubgen_target = custom_target(
# 'generate-stubs',
# command: stubgen_command,
# input: [nanobind_ext],
# output: 'stubs',
# depends: [nanobind_ext],
# build_by_default: true
# )