-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwscript
executable file
·148 lines (126 loc) · 4.53 KB
/
wscript
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
145
146
147
148
#!/usr/bin/env python
from waflib.extras.gtest import summary
from waflib import Utils
APPNAME='hwdb'
def depends(ctx):
ctx('halco')
ctx('logger')
ctx('hate')
if getattr(ctx.options, 'with_hwdb_python_bindings', True):
ctx('pywrap')
def options(opt):
opt.load('compiler_cxx')
opt.load('gtest')
hopts = opt.add_option_group('hwdb options')
hopts.add_withoption('hwdb-python-bindings', default=True,
help='Toggle the generation and build of hwdb python bindings')
def configure(cfg):
cfg.load('compiler_cxx')
cfg.load('gtest')
if getattr(cfg.options, 'with_hwdb_python_bindings', True):
cfg.load('python')
cfg.check_python_version()
cfg.check_python_headers()
cfg.load('genpybind')
cfg.env.with_hwdb_python_bindings = cfg.options.with_hwdb_python_bindings
cfg.check_cfg(package='yaml-cpp',
args=['yaml-cpp >= 0.5.3', '--cflags', '--libs'],
uselib_store='YAMLCPP')
cfg.env.CXXFLAGS_HWDB = [
'-fvisibility=hidden',
'-fvisibility-inlines-hidden',
]
cfg.env.LINKFLAGS_HWDB = [
'-fvisibility=hidden',
'-fvisibility-inlines-hidden',
]
def build(bld):
bld.add_post_fun(summary)
bld.install_files(
dest='${PREFIX}/include',
files=bld.path.ant_glob('hwdb4cpp/*.h'),
name='hwdb_header',
relative_trick=True
)
bld(
target = 'hwdb4cpp_inc',
export_includes = '.',
use = 'hwdb_header'
)
bld.shlib(
target = 'hwdb4cpp',
features = 'cxx',
source = 'hwdb4cpp/hwdb4cpp.cpp',
use = 'halco_hicann_v2 hwdb4cpp_inc logger_obj YAMLCPP hate_inc',
uselib = 'HWDB',
install_path = '${PREFIX}/lib',
)
bld(
target = 'hwdb4c',
features = 'cxx cxxshlib',
source = 'hwdb4cpp/hwdb4c.cpp',
use = 'hwdb4cpp',
install_path = '${PREFIX}/lib',
uselib = 'HWDB',
)
bld.program(
target = 'hwdb_tests',
source = bld.path.ant_glob('test/test_*.cpp'),
features = 'cxx gtest',
test_main = 'test/test-main.cpp',
use = [ 'GTEST', 'hwdb4c' ],
install_path = '${PREFIX}/bin',
linkflags = ['-lboost_program_options'],
)
if bld.env.build_python_bindings and bld.env.with_hwdb_python_bindings:
assert not bld.env.with_pybind
bld(
target = 'pyhwdb',
features = 'cxx cxxshlib pypp pyext',
script = 'pyhwdb/generate.py',
gen_defines = 'PYPLUSPLUS __STRICT_ANSI__',
defines = 'PYBINDINGS',
headers = 'pyhwdb/pyhwdb.h',
use = ['hwdb4cpp', 'pyhalco_hicann_v2', 'pywrap'],
)
if bld.env.with_pybind and bld.env.with_hwdb_python_bindings:
assert not bld.env.build_python_bindings
bld(
target = 'pyhwdb',
features = 'genpybind cxx cxxshlib pyext',
source = 'pyhwdb/pyhwdb.h',
genpybind_tags = 'hwdb',
use = ['hwdb4cpp', 'pyhalco_common'],
)
if (bld.env.build_python_bindings or bld.env.with_pybind) and bld.env.with_hwdb_python_bindings:
bld(
name = "pyhwdb_tests",
tests = 'pyhwdb/test/pyhwdb_test.py',
features = 'use pytest',
use = 'pyhwdb',
install_path = '${PREFIX}/bin',
test_timeout = 45,
pythonpath = ["test"],
)
if bld.env.build_python_bindings and bld.env.with_hwdb_python_bindings:
bld(
target = 'pyhwdb_bss1_tools',
features = 'use py',
use = 'pyhwdb',
source = bld.path.ant_glob('pyhwdb/tools/bss1/*.py'),
install_path = '${PREFIX}/bin',
relative_trick = False,
chmod = Utils.O755
)
tools_tests_path='pyhwdb/test/bss1/pyhwdb_tools_test.py'
bld(
name="pyhwdb_bss1_tools_tests",
tests=tools_tests_path,
source=tools_tests_path,
features='use pytest py',
use='pyhwdb_bss1_tools',
install_path='${PREFIX}/bin',
test_timeout=15,
relative_trick=False,
chmod=Utils.O755
)