mirror of https://github.com/ArduPilot/ardupilot
build: protect ap_version.h from inclusion
This commit is contained in:
parent
11e47fb145
commit
cd81b27c05
|
@ -236,7 +236,15 @@ def ap_version_append_str(ctx, k, v):
|
|||
@conf
|
||||
def write_version_header(ctx, tgt):
|
||||
with open(tgt, 'w') as f:
|
||||
print('#pragma once\n', file=f)
|
||||
print(
|
||||
'''// auto-generated header, do not edit
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef FORCE_VERSION_H_INCLUDE
|
||||
#error ap_version.h should never be included directly. You probably want to include AP_Common/AP_FWVersion.h
|
||||
#endif
|
||||
''', file=f)
|
||||
|
||||
for k, v in ctx.env['AP_VERSION_ITEMS']:
|
||||
print('#define {} {}'.format(k, v), file=f)
|
||||
|
|
Loading…
Reference in New Issue