-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
81 lines (61 loc) · 1.57 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
69
70
71
72
73
74
75
76
77
78
79
80
81
project('cyantities', 'cpp', 'cython',
version : '0.5.0', default_options : ['optimization=3'])
#
# Include directory:
#
incdir = include_directories('cyantities/_cpp/')
#
# Dependencies:
#
boost_dep = dependency('boost')
#
# Find the NumPy headers here:
#
python = import('python').find_installation()
dep_py = python.dependency()
incpath_np = run_command(
'gravelspoon',
check : false
)
if incpath_np.returncode() != 0
message(incpath_np.stdout().strip())
message(incpath_np.stderr().strip())
error('Could not determine NumPy include path.')
else
incpath_np = incpath_np.stdout().strip()
endif
incdir_np = include_directories([incpath_np, incpath_np / '..' / '..' / '..'])
add_project_arguments(['-I' + incpath_np + '/../../../'], language : 'cython')
add_project_arguments(['-std=c++20','-Wall'], language : 'cpp')
#
# Static libraries:
#
libcyantities = static_library(
'cyantities',
[
'cyantities/_cpp/src/unit.cpp',
'cyantities/_cpp/src/quantitywrap.cpp'
],
dependencies : boost_dep,
include_directories : incdir,
install : true
)
#
# Python extension modules:
#
python.extension_module(
'unit',
'cyantities/unit.pyx',
dependencies : [dep_py],
include_directories : [incdir, incdir_np],
override_options : ['cython_language=cpp'],
link_with : libcyantities
)
python.extension_module(
'quantity',
'cyantities/quantity.pyx',
dependencies : [dep_py],
include_directories : [incdir, incdir_np],
override_options : ['cython_language=cpp'],
link_with : libcyantities
)