-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
58 lines (51 loc) · 1.17 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
project('libvna', 'c', 'cython',
version: '0.1.4',
license: 'GPL-3',
default_options: [
'buildtype=debugoptimized',
'b_ndebug=if-release',
'c_std=c99',
],
)
py_mod = import('python')
py3 = py_mod.find_installation(pure: false)
dep_py = py3.dependency()
dep_vna = dependency('libvna', version: '>=0.3.9')
srcdir = meson.source_root()
testdir = join_paths(srcdir, 'tests')
builddir = meson.current_build_dir()
incdir_numpy = meson.get_external_property('numpy-include-dir', 'none')
if incdir_numpy == 'none'
incdir_numpy = run_command(py3, ['-c',
'''
import numpy as np
import os
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)
dep_np = declare_dependency(include_directories: inc_np)
test(
'test_cal',
py3,
args: [join_paths(testdir, 'test_cal.py')],
workdir: builddir
)
test(
'test_conv',
py3,
args: [join_paths(testdir, 'test_conv.py')],
workdir: builddir
)
test(
'test_data',
py3,
args: [join_paths(testdir, 'test_data.py')],
workdir: builddir
)
subdir('libvna')