Have meson specify output file to generate_protocol.py
This commit is contained in:
parent
47430c68d2
commit
14e416b909
|
@ -69,8 +69,8 @@ def print_protocol():
|
|||
True)
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print('Please specify the input file.')
|
||||
if len(sys.argv) != 3:
|
||||
print('Usage: generate_protocol.py <input: protocol.hjson> <output: ProtocolDefinitions.h>')
|
||||
return
|
||||
|
||||
add_text('#pragma once')
|
||||
|
@ -84,7 +84,7 @@ def main():
|
|||
add_text('}}')
|
||||
add_text('')
|
||||
|
||||
with open('ProtocolDefinitions.h', 'w') as out_file:
|
||||
with open(sys.argv[2], 'w') as out_file:
|
||||
out_file.write(text)
|
||||
out_file.close()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
protocol_headers = custom_target('ProtocolHeader',
|
||||
input : [ 'generate_protocol.py', 'protocol.hjson' ],
|
||||
output : [ 'ProtocolDefinitions.h' ],
|
||||
command : [ python, '@INPUT@' ])
|
||||
command : [ python, '@INPUT@', '@OUTPUT@' ])
|
Loading…
Reference in New Issue