-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
46 lines (40 loc) · 1.01 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
project(
'minifftw', 'c',
version : '1',
license : 'GPL',
meson_version : '>= 0.47',
)
pymod = import('python')
py = pymod.find_installation('python3', required : true)
c_srcs = ['minifftw.c', 'plancapsule.c', 'util.c']
# numpy dependency consist of just includes
message('searching numpy include dirs')
numpy_cmd = run_command(
'python3',
['-c', 'import numpy; print(numpy.get_include())'],
check : true,
)
numpy_dep = declare_dependency(
include_directories : include_directories(numpy_cmd.stdout().strip())
)
cc = meson.get_compiler('c')
minifftw_c_args = []
minifftw_link_args = ['-lfftw3_threads']
minifftw_deps = [
dependency('threads'),
cc.find_library('m', required : true),
py.dependency(),
numpy_dep,
]
if get_option('mpi')
minifftw_c_args += '-DMFFTW_MPI'
minifftw_link_args += '-lfftw3_mpi'
minifftw_deps += dependency('mpi', language: 'c')
endif
py.extension_module(
'minifftw',
c_srcs,
dependencies : minifftw_deps,
c_args : minifftw_c_args,
link_args : minifftw_link_args,
)