-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeson.build
72 lines (62 loc) · 2.68 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
project('pyqcs', 'cpp', 'c', version:'3.0.0')
add_global_arguments('-O3', language:'cpp')
#####################################################################################
############### This section contains the purely C++ part ###########################
#####################################################################################
incdir_backend = include_directories('src/backend/include/')
incdir_rbtree = include_directories('src/backend/rbtree/include/')
incdir = [incdir_backend, incdir_rbtree]
ll = shared_library('ll'
, 'src/backend/rbtree/src/ll/ll.cpp'
, include_directories:incdir)
rbt = shared_library('rbt'
, 'src/backend/rbtree/src/rbt/tree.cpp'
, 'src/backend/rbtree/src/rbt/iterator.cpp'
, install:true
, include_directories:incdir)
dsv = shared_library('dsv'
, 'src/backend/src/dsv.cpp'
, include_directories:incdir)
graphical = shared_library('graphical'
, 'src/backend/src/graphical.cpp'
, include_directories:incdir
, install:true
, link_with:[rbt])
graphical2dsv = shared_library('graphical2dsv'
, 'src/backend/src/graphical2dsv.cpp'
, include_directories:incdir
, link_with:[graphical
, dsv])
#####################################################################################
######### This section contains the pure python part and setup ######################
#####################################################################################
pymod = import('python')
python = pymod.find_installation('python3')
pydep = python.dependency()
subdir('src/pyqcs')
#####################################################################################
###### This section contains the new backend compilation ############################
#####################################################################################
numpy_cmd = run_command(python, ['-c', 'import numpy; print(numpy.get_include())'], check : true )
message(numpy_cmd.stdout().strip())
message('include_directories(numpy_cmd.stdout().strip())')
numpy_incdir = include_directories(numpy_cmd.stdout().strip())
numpy_dep = declare_dependency(include_directories: numpy_incdir)
python.extension_module(
'rawstate'
, ['src/pyqcs/graph/rawstate.cpp'
, 'src/backend/src/graphical.cpp'
, 'src/backend/rbtree/src/rbt/tree.cpp'
, 'src/backend/rbtree/src/rbt/iterator.cpp']
, dependencies: pydep
, install:true
, subdir: 'pyqcs/graph'
, include_directories: incdir)
python.extension_module(
'dsv'
, ['src/pyqcs/state/dsv.cpp'
, 'src/backend/src/dsv.cpp']
, dependencies: [pydep, numpy_dep]
, install:true
, subdir: 'pyqcs/state'
, include_directories: incdir)