-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwscript
More file actions
144 lines (124 loc) · 4.44 KB
/
wscript
File metadata and controls
144 lines (124 loc) · 4.44 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import os
from os.path import join
from waflib import Utils
from waflib.extras.test_base import summary
from waflib.extras.symwaf2ic import get_toplevel_path
from waflib.extras.symwaf2ic import describe_project
def depends(dep):
dep("code-format")
dep("haldls")
dep.execute()
def recurse(deps, name, alldeps):
for subname in deps[name]:
if subname not in alldeps:
alldeps.add(subname)
recurse(deps, subname, alldeps)
alldeps = set()
recurse(dep.dependencies, dep.path.abspath(), alldeps)
global _dependencies
_dependencies = set(
ctx.replace(dep.toplevel.abspath() + "/", "").split("/")[0] for ctx in alldeps)
def options(opt):
opt.load('pytest')
opt.load('pylint')
opt.load('pycodestyle')
opt.load('doxygen')
opt.load("compiler_cxx")
opt.load("genpybind")
def configure(cfg):
cfg.load('python')
cfg.check_python_version()
cfg.load('pytest')
cfg.load('pylint')
cfg.load('pycodestyle')
cfg.load('doxygen')
cfg.load("compiler_cxx")
cfg.load("genpybind")
cfg.env.DEFINES_CALIX = [
'CALIX_REPO_STATE="' + "; ".join([
describe_project(cfg, dep).replace('"', '\\"') for dep in _dependencies] +
[describe_project(cfg, 'calix').replace('"', '\\"') + '"'])
]
def build(bld):
bld.env.BBS_HARDWARE_AVAILABLE = "SLURM_HWDB_YAML" in os.environ
bld(name="ccalix_includes",
export_includes="include")
bld(target="ccalix",
features="cxx cxxshlib pyembed",
source=bld.path.ant_glob("src/cc/ccalix/**/*.cpp"),
use=[
"ccalix_includes",
"stadls_vx_v3",
"halco_hicann_dls_vx_v3",
"haldls_vx_v3",
],
uselib='CALIX',
export_defines=bld.env.DEFINES_CALIX)
bld(target="pyccalix",
features="genpybind cxx cxxshlib pyext pyembed",
source="include/ccalix/ccalix.h",
use=[
"ccalix",
"pyhalco_hicann_dls_vx_v3",
"pyhaldls_vx_v3",
"pystadls_vx_v3",
],
genpybind_tags="ccalix",
genpybind_num_files=1,
linkflags="-Wl,-z,defs")
bld(name='calix_pylib',
source=bld.path.ant_glob('src/py/**/*.py'),
use='dlens_vx_v3 pyccalix',
features='py use',
install_from='src/py',
relative_trick=True,
)
bld(name='calix_scripts',
source=bld.path.ant_glob('src/py/calix/scripts/**/*.py'),
use='calix_pylib',
features='py use',
install_path='${PREFIX}/bin',
install_from='src/py/calix/scripts',
chmod=Utils.O755,
)
bld(name='calix_python_code_analysis',
tests=bld.path.ant_glob('src/py/**/*.py'),
use='dlens_vx_v3 pyccalix',
features='use pylint pycodestyle',
pylint_config=join(get_toplevel_path(), "code-format", "pylintrc"),
pycodestyle_config=join(get_toplevel_path(), "code-format", "pycodestyle"),
test_timeout=120,
)
bld(name='calix_pyswtests',
tests=bld.path.ant_glob('tests/sw/py/**/*.py'),
features='use pytest pylint pycodestyle',
use='calix_pylib',
install_path='${PREFIX}/bin/tests',
pylint_config=join(get_toplevel_path(), "code-format", "pylintrc"),
pycodestyle_config=join(get_toplevel_path(), "code-format", "pycodestyle"),
test_timeout=1800, # 30 minutes
)
bld(name='calix_pyhwtests',
tests=bld.path.ant_glob('tests/hw/py/**/*.py'),
features='use pytest pylint pycodestyle',
use=['calix_pylib', 'quiggeldy'],
install_path='${PREFIX}/bin/tests',
pylint_config=join(get_toplevel_path(), "code-format", "pylintrc"),
pycodestyle_config=join(get_toplevel_path(), "code-format", "pycodestyle"),
skip_run=not bld.env.BBS_HARDWARE_AVAILABLE,
test_timeout=45 * 60
)
if bld.env.DOXYGEN:
bld(
target = 'doxygen_calix',
features = 'doxygen',
doxyfile = bld.root.make_node(join(get_toplevel_path(), "code-format", "doxyfile")),
doxy_inputs = 'include/ccalix',
install_path = 'doc/calix',
pars = {
"PROJECT_NAME": "\"calix\"",
"INCLUDE_PATH": join(get_toplevel_path(), "calix", "include"),
"OUTPUT_DIRECTORY": join(get_toplevel_path(), "build", "calix", "doc")
},
)
bld.add_post_fun(summary)