-
Notifications
You must be signed in to change notification settings - Fork 3
/
meson.build
47 lines (39 loc) · 1.24 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
# Declare global project options:
# package name
# programming languages
project(
'mc_lib',
['cpp', 'cython'],
default_options : ['warning_level=3', 'buildtype=debugoptimized'],
version: '0.4.1',
license: 'BSD-2',
meson_version: '>= 0.54',
)
# Special check for MacOS, cause of cpp version
if build_machine.system() == 'darwin'
add_global_arguments('-std=c++17', language : 'cpp')
message('found OS X, add special argument to compiler')
endif
# Seek the backend
if meson.backend() != 'ninja'
error('Ninja backend required')
endif
# Seek for Cython installation
cython = find_program('cython', required : true)
if not cython.found()
error('Cython not found.')
endif
# Python default installton path and basic dependecies
py_mod = import('python')
py3 = py_mod.find_installation()
py3_dep = py3.dependency()
# Thx rgommers "https://github.com/rgommers/scipy/blob/meson/scipy/meson.build"
# NumPy include directory - needed in all submodules
incdir_numpy = run_command(py3,
['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'],
check : true
).stdout().strip()
# Declare numpy as dependency
inc_np = include_directories(incdir_numpy)
numpy_nodepr_api = '-DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION'
subdir('mc_lib')