-
Notifications
You must be signed in to change notification settings - Fork 4
/
wscript
executable file
·112 lines (91 loc) · 3.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
#!/usr/bin/env python
import sys, os, copy
from waflib import Node
from waflib.extras import symwaf2ic
def depends(ctx):
ctx('logger')
if ctx.options.with_flansch:
ctx('flansch')
def options(opt):
opt.load('compiler_cxx')
opt.load('boost')
hopts = opt.add_option_group('Vmodule Options')
hopts.add_withoption('flansch', default=False,
help='Enable/Disable flansch backend')
hopts.add_withoption('tests', default=True,
help='Enable/Disable build of flyspi tests')
def configure(cfg):
cfg.load('compiler_cxx')
cfg.load('boost')
cfg.check_boost(lib='system thread serialization', uselib_store='BOOST4PYFLYSPI')
cfg.check_boost(lib='program_options system thread serialization', uselib_store='BOOST4FLYSPITOOLS')
cfg.check_cfg(package='libusb-1.0', args=['--cflags', '--libs'], uselib_store='USB')
cfg.env.enable_flansch = cfg.options.with_flansch
cfg.env.enable_tests = cfg.options.with_tests
def build(bld):
cxxflags = []
SOURCES = [
'units/vmodule_base/source/vmodule.cpp',
'units/vmodule_base/source/readhex.cpp',
'units/flyspi/source/Vmodule_adc.cpp',
'units/flyspi/source/Vmoduleusb.cpp',
'units/flyspi/source/Vusbmaster.cpp',
'units/flyspi/source/Vusbstatus.cpp',
'units/flyspi/source/Vmemory.cpp',
'units/flyspi/source/Vocpfifo.cpp',
'units/flyspi/source/Vocpmodule.cpp',
'units/flyspi/source/Vspiconfrom.cpp',
'units/flyspi/source/Vspigyro.cpp',
'units/flyspi/source/Vspigyrowl.cpp',
'units/flyspi/source/Vspimodule.cpp',
'units/flyspi/source/Vspiwireless.cpp',
'units/flyspi/source/Vmux_board.cpp',
#Spikey specific
'units/flyspi/source/Vspikey.cpp',
'units/flyspi/source/Vspidac.cpp',
#ADC board specific
'units/flyspi/source/Vspifastadc.cpp',
'units/flyspi/source/Vlmh6518.cpp',
]
vmodule_object_use = ['USB', 'logger_obj', 'vmodule_objects_inc', 'usbcomm']
if bld.env.enable_flansch:
cxxflags.append('-DWITH_FLANSCH')
SOURCES.append('units/vmodule_base/source/Vmodulesim.cpp')
vmodule_object_use.extend(['flansch_inc','flansch_software'])
bld (
export_includes = '. units/vmodule_base/source/ units/flyspi/source/',
name = 'vmodule_objects_inc',
)
bld.objects(
source = [
'units/flyspi/source/usbcom.cpp',
'units/flyspi/source/error_base.cpp',
],
target = 'usbcomm',
name = 'usbcomm',
use = ['USB','logger_obj'],
cxxflags=cxxflags + ['-fPIC']
)
bld.objects(
name = 'vmodule_objects',
target = 'vmodule_objects',
source = SOURCES,
use = vmodule_object_use,
cxxflags=cxxflags + ['-fPIC']
)
for filename in bld.path.ant_glob('units/flyspi/tools/*.cpp'):
split = Node.split_path(filename.abspath())
bld.program (
target = os.path.splitext(split[len(split)-1])[0],
source = [filename],
use = ['BOOST4FLISPY', 'USB', 'BOOST4FLYSPITOOLS', 'vmodule_objects', 'logger_obj'],
install_path = 'bin',
cxxflags=cxxflags
)
if bld.env.enable_tests:
bld(target = 'vmodule_flyspi_hwtests',
features = 'cxx cxxprogram gtest',
source = bld.path.ant_glob('units/flyspi/test/*.cpp'),
use = [ 'vmodule_objects' ],
skip_run = True
)