Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Ardupilot
GitHub Repository: Ardupilot/ardupilot
Path: blob/master/Tools/ardupilotwaf/hal_common.py
9659 views
1
"""
2
Waf tool for functions common to the esp32, Linux and ChibiOS builds.
3
4
AP_FLAKE8_CLEAN
5
"""
6
7
8
def process_hwdef_results(cfg, hwdef_obj):
9
# load environment variables
10
env = cfg.env
11
for k, v in hwdef_obj.env_vars.items():
12
if k in env:
13
# don't want to encourage modifications from the hwdef
14
raise ValueError(f"hwdef redefines environment variable {k} "
15
f"with existing value {env[k]!r} to value {v!r}")
16
else:
17
env[k] = v
18
print("env set %s=%s" % (k, v))
19
20
# note files generated by hwdef system as cfg_files. this ensures they
21
# don't get deleted on `./waf clean`. this also ensures their node exists
22
# so implicit dependencies are properly tracked.
23
bldnode = cfg.bldnode.make_node(cfg.variant)
24
for file in sorted(hwdef_obj.output_files):
25
env.append_value("cfg_files", bldnode.make_node(file).abspath())
26
27