forked from commaai/rednose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConscript
32 lines (23 loc) · 1.19 KB
/
SConscript
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
Import('env', 'arch')
templates = Glob('#rednose/templates/*')
# TODO: get dependencies based on installation
sympy_helpers = "#rednose/helpers/sympy_helpers.py"
ekf_sym = "#rednose/helpers/ekf_sym.py"
to_build = {
'live': ('examples/live_kf.py', 'examples/generated'),
'kinematic': ('examples/kinematic_kf.py', 'examples/generated'),
'pos_computer_4': ('rednose/helpers/lst_sq_computer.py', 'examples/generated'),
'pos_computer_5': ('rednose/helpers/lst_sq_computer.py', 'examples/generated'),
'feature_handler_5': ('rednose/helpers/feature_handler.py', 'examples/generated'),
}
found = {}
for target, (command, generated_folder) in to_build.items():
if File(command).exists():
found[target] = (command, generated_folder)
for target, (command, generated_folder) in found.items():
target_files = File([f'{generated_folder}/{target}.cpp', f'{generated_folder}/{target}.h'])
command_file = File(command)
env.Command(target_files,
[templates, command_file, sympy_helpers, ekf_sym],
command_file.get_abspath() + " " + target + " " + Dir(generated_folder).get_abspath())
env.SharedLibrary(f'{generated_folder}/' + target, target_files[0])