-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
62 lines (54 loc) · 1.2 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
project('skfmm', 'cpp', version: '2024.09.16')
py = import('python').find_installation()
incdir_numpy = meson.get_external_property('numpy-include-dir', 'not-given')
if incdir_numpy == 'not-given'
incdir_numpy = run_command(py,
[
'-c',
'''
import os
import numpy as np
try:
incdir = os.path.relpath(np.get_include())
except Exception:
incdir = np.get_include()
print(incdir)
'''
],
check: true
).stdout().strip()
endif
inc_np = include_directories(incdir_numpy)
np_dep = declare_dependency(include_directories: inc_np)
includes = include_directories('skfmm')
srcs = [
'skfmm/fmm.cpp',
'skfmm/heap.cpp',
'skfmm/base_marcher.cpp',
'skfmm/distance_marcher.cpp',
'skfmm/travel_time_marcher.cpp',
'skfmm/extension_velocity_marcher.cpp',
]
py.install_sources(
['skfmm/__init__.py',
'skfmm/pfmm.py',
'skfmm/heap.py'],
subdir: 'skfmm',
pure: false,
)
py.extension_module(
'cfmm',
srcs,
install: true,
subdir: 'skfmm',
include_directories: [includes, inc_np],
dependencies: [np_dep],
)
py.extension_module(
'pheap',
['skfmm/pheap.cpp',
'skfmm/heap.cpp'],
install: true,
subdir: 'skfmm',
include_directories: includes,
)