2023-12-25 15:31:16 -04:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import pathlib
|
2023-12-27 18:08:19 -04:00
|
|
|
import platform
|
2023-12-25 15:31:16 -04:00
|
|
|
|
|
|
|
def configure(cfg):
|
2023-12-27 02:11:19 -04:00
|
|
|
|
|
|
|
if not cfg.env.BOARD_CLASS in ['SITL', 'LINUX', 'ChibiOS']:
|
|
|
|
return
|
|
|
|
|
2024-01-09 05:59:26 -04:00
|
|
|
# networking doesn't build with clang unless using macOS
|
|
|
|
if platform.system() != 'Darwin' and 'clang++' in cfg.env.COMPILER_CXX:
|
|
|
|
return
|
2023-12-27 18:08:19 -04:00
|
|
|
|
2023-12-25 15:31:16 -04:00
|
|
|
extra_src = [
|
2023-12-24 23:40:32 -04:00
|
|
|
'modules/lwip/src/core/*c',
|
|
|
|
'modules/lwip/src/core/ipv4/*c',
|
|
|
|
'modules/lwip/src/api/*c',
|
|
|
|
'modules/lwip/src/netif/*c',
|
|
|
|
'modules/lwip/src/netif/ppp/*c',
|
2023-12-25 15:31:16 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
extra_src_inc = [
|
2023-12-24 23:40:32 -04:00
|
|
|
'modules/lwip/src/include',
|
2023-12-25 15:31:16 -04:00
|
|
|
]
|
|
|
|
|
2023-12-24 23:40:32 -04:00
|
|
|
extra_src.extend(['libraries/AP_Networking/lwip_hal/arch/*cpp'])
|
2023-12-28 17:14:13 -04:00
|
|
|
|
|
|
|
if cfg.env.BOARD_CLASS == 'ChibiOS':
|
|
|
|
extra_src.extend(['libraries/AP_Networking/lwip_hal/arch/evtimer.c'])
|
|
|
|
|
2023-12-24 23:40:32 -04:00
|
|
|
extra_src_inc.extend(['libraries/AP_Networking/config',
|
|
|
|
'libraries/AP_Networking/lwip_hal/include'])
|
2023-12-25 15:31:16 -04:00
|
|
|
|
|
|
|
cfg.env.AP_LIB_EXTRA_SOURCES['AP_Networking'] = []
|
|
|
|
for pattern in extra_src:
|
|
|
|
s = cfg.srcnode.ant_glob(pattern, dir=False, src=True)
|
|
|
|
for x in s:
|
|
|
|
cfg.env.AP_LIB_EXTRA_SOURCES['AP_Networking'].append(str(x))
|
|
|
|
|
|
|
|
for inc in extra_src_inc:
|
|
|
|
cfg.env.INCLUDES += [str(cfg.srcnode.make_node(inc))]
|