1
- # NumPy include directory - needed in all submodules
2
- # The try-except is needed because when things are split across drives on Windows, there
3
- # is no relative path and an exception gets raised. There may be other such cases, so add
4
- # a catch-all and switch to an absolute path. Relative paths are needed when for example
5
- # a virtualenv is placed inside the source tree; Meson rejects absolute paths to places
6
- # inside the source tree.
7
- # For cross-compilation it is often not possible to run the Python interpreter in order
8
- # to retrieve numpy's include directory. It can be specified in the cross file instead:
9
- #
10
- # [properties]
11
- # numpy-include-dir = /abspath/to/host-pythons/site-packages/numpy/core/include
12
- #
13
- # This uses the path as is, and avoids running the interpreter.
14
- incdir_numpy = meson .get_external_property(' numpy-include-dir' , ' not-given' )
15
- if incdir_numpy == ' not-given'
16
- incdir_numpy = run_command (py3,
17
- [
18
- ' -c' ,
19
- ''' import os
20
- import numpy as np
21
- try:
22
- incdir = os.path.relpath(np.get_include())
23
- except Exception:
24
- incdir = np.get_include()
25
- print(incdir)'''
26
- ],
27
- check : true
28
- ).stdout().strip()
29
- endif
30
- numpy_dep = declare_dependency (
31
- compile_args : [
32
- ' -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION' ,
33
- # Allow NumPy's printf format specifiers in C++.
34
- ' -D__STDC_FORMAT_MACROS=1' ,
35
- ],
36
- include_directories : include_directories (incdir_numpy),
37
- dependencies : py3_dep,
38
- )
39
-
40
1
# For cross-compilation it is often not possible to run the Python interpreter in order
41
2
# to retrieve the platform-specific /dev/null. It can be specified in the cross file
42
3
# instead:
@@ -76,7 +37,7 @@ extension_data = {
76
37
' _backend_agg.cpp' ,
77
38
' _backend_agg_wrapper.cpp' ,
78
39
),
79
- ' dependencies' : [agg_dep, numpy_dep, freetype_dep, pybind11_dep],
40
+ ' dependencies' : [agg_dep, freetype_dep, pybind11_dep],
80
41
},
81
42
' _c_internal_utils' : {
82
43
' subdir' : ' matplotlib' ,
@@ -92,7 +53,7 @@ extension_data = {
92
53
' ft2font_wrapper.cpp' ,
93
54
),
94
55
' dependencies' : [
95
- freetype_dep, pybind11_dep, numpy_dep, agg_dep.partial_dependency(includes : true ),
56
+ freetype_dep, pybind11_dep, agg_dep.partial_dependency(includes : true ),
96
57
],
97
58
' cpp_args' : [
98
59
' -DFREETYPE_BUILD_TYPE="@0@"' .format(
@@ -117,7 +78,7 @@ extension_data = {
117
78
' sources' : files (
118
79
' _path_wrapper.cpp' ,
119
80
),
120
- ' dependencies' : [numpy_dep, agg_dep, pybind11_dep],
81
+ ' dependencies' : [agg_dep, pybind11_dep],
121
82
},
122
83
' _qhull' : {
123
84
' subdir' : ' matplotlib' ,
@@ -157,16 +118,7 @@ extension_data = {
157
118
}
158
119
159
120
foreach ext, kwargs : extension_data
160
- # Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each extension.
161
- unique_array_api = ' -DPY_ARRAY_UNIQUE_SYMBOL=MPL_@0@_ARRAY_API' .format(ext.replace(' .' , ' _' ))
162
- additions = {
163
- ' c_args' : [unique_array_api] + kwargs.get(' c_args' , []),
164
- ' cpp_args' : [unique_array_api] + kwargs.get(' cpp_args' , []),
165
- }
166
- py3.extension_module(
167
- ext,
168
- install : true ,
169
- kwargs : kwargs + additions)
121
+ py3.extension_module(ext, install : true , kwargs : kwargs)
170
122
endforeach
171
123
172
124
if get_option (' macosx' ) and host_machine .system() == ' darwin'
0 commit comments