-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
68 lines (60 loc) · 1.38 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
65
66
67
68
project(
'pymt_heatc',
'c', 'cython',
license: 'MIT',
)
py = import('python').find_installation(pure: false)
python_inc = py.get_path('data') / 'include'
numpy_inc = run_command(
py,
[
'-c',
'import numpy; print(numpy.get_include())'
],
check: true
).stdout().strip()
incs = include_directories(
[
meson.project_name() / 'lib',
python_inc,
numpy_inc,
]
)
deps = [
dependency('bmiheatc'),
py.dependency(),
]
srcs = [
meson.project_name() / 'lib/heatmodelc.pyx',
]
# Files get copied to <python directory>/site-packages/<subdir>
install_pkg_srcs = [
meson.project_name() / '__init__.py',
meson.project_name() / '_bmi.py',
]
py.install_sources(
install_pkg_srcs,
subdir: meson.project_name(),
)
install_lib_srcs = [
meson.project_name() / 'lib/__init__.py',
meson.project_name() / 'lib/heatmodelc.pyx',
]
py.install_sources(
install_lib_srcs,
subdir: meson.project_name() / 'lib',
)
install_subdir(
'meta/HeatModelC',
install_dir: py.get_install_dir() / meson.project_name() / 'data',
)
py.extension_module(
'heatmodelc',
srcs,
dependencies: deps,
include_directories: incs,
install: true,
subdir: meson.project_name() / 'lib',
)
# This is a temporary fix for editable installs.
run_command('cp', '-r', meson.project_name() / 'data', 'build', check: false)