-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
69 lines (58 loc) · 2.31 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
project('photon-aerobot', 'c', default_options : ['c_std=c99'])
cfg = configuration_data()
cfg.set('PHOTON_ROOT', join_paths(meson.source_root(), 'subprojects/photon'))
if meson.is_subproject()
cfg.set('AEROBOT_ROOT', join_paths(meson.source_root(), 'subprojects/photon-aerobot'))
else
cfg.set('AEROBOT_ROOT', meson.source_root())
endif
configure_file(
input : 'project-meson.toml.in',
output : 'project-meson.toml',
configuration : cfg,
)
modules_src = [
'modules/aerobot/udp/mod.toml',
'modules/aerobot/udp/udp.decode',
'modules/photon/powerfan/mod.toml',
'modules/photon/powerfan/powerfan.decode',
'modules/photon/powerfan/Stub.c',
'modules/photon/px4_autogen/mod.toml',
'modules/photon/px4_autogen/px4_autogen.decode',
'modules/photon/px4_autogen/Px4_autogen.c',
'modules/photon/esc/mod.toml',
'modules/photon/esc/Stub.c',
'modules/photon/esc/esc.decode',
'modules/photon/powercom/mod.toml',
'modules/photon/powercom/Stub.c',
'modules/photon/powercom/powercom.decode',
'modules/photon/powerfanproxy/powerfanproxy.decode',
'modules/photon/zlidar/mod.toml',
'modules/photon/zlidar/zlidar.decode',
'modules/photon/ximea/mod.toml',
'modules/photon/ximea/ximea.decode',
'modules/photon/zcvm/Stub.c',
'modules/photon/zcvm/zcvm.decode',
]
photon_opts = []
mod_opt = '['
foreach m : modules_src
mod_opt += '\''
mod_opt += join_paths(meson.current_source_dir(), m)
mod_opt += '\','
endforeach
mod_opt += ']'
photon_opts += 'project=project-meson.toml'
photon_opts += 'project_prefix=' + meson.current_build_dir()
photon_opts += 'additional_depends=' + mod_opt
photon_opts += 'targets=[\'cvm\', \'fcu\', \'powercom\']'
photon_opts += 'use_stubs=' + get_option('use_stubs').to_string()
photon_opts += 'log_level=' + get_option('log_level')
photon_opts += 'target_tests=' + get_option('target_tests').to_string()
photon_mod = subproject('photon', default_options : photon_opts)
photon_dep = photon_mod.get_variable('photon_dep')
gen_src_dep = photon_mod.get_variable('gen_src_dep')
photon_target_cvm_lib = photon_mod.get_variable('photon_target_cvm_lib')
photon_target_cvm_dep = [photon_mod.get_variable('photon_target_cvm_dep'), gen_src_dep]
photon_target_fcu_lib = photon_mod.get_variable('photon_target_fcu_lib')
photon_target_fcu_dep = [photon_mod.get_variable('photon_target_fcu_dep'), gen_src_dep]