-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
65 lines (54 loc) · 1.46 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
project('pyflowy', 'cpp',
default_options : ['warning_level=3', 'cpp_std=c++20'])
args = []
deps = []
cppc = meson.get_compiler('cpp')
flowy_proj = subproject('flowy', default_options: ['default_library=static',
# Flowy-specific
'build_tests=false',
'build_exe=false'])
flowylib = flowy_proj.get_variable('flowylib_static_dep')
deps += [flowylib]
if flowy_proj.get_variable('with_netcdf')
args += ['-DWITH_NETCDF']
endif
py = import('python').find_installation('python', modules: ['numpy'])
deps += py.dependency()
# NumPy dependency
incdir_numpy = run_command(py,
['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'],
check : true
).stdout().strip()
inc_np = include_directories(incdir_numpy)
deps += declare_dependency(include_directories: inc_np)
pyb11_dep = [
py.dependency(),
dependency('pybind11')
]
deps += [pyb11_dep]
# for the bindings
py.extension_module(
'flowycpp',
sources : [
'python_bindings/bindings.cpp'
],
include_directories: inc_np,
dependencies: deps,
cpp_args : args,
install: true,
subdir: 'pyflowy/'
)
# pyflowy main package
py.install_sources([
'pyflowy/__init__.py',
],
pure: false, # install next to compiled extension
subdir: 'pyflowy'
)
# Util
py.install_sources([
'pyflowy/util.py',
],
pure: false,
subdir: 'pyflowy'
)