Have meson specify output file to generate_protocol.py

This commit is contained in:
DankParrot 2020-08-01 20:06:45 -07:00
parent 47430c68d2
commit 14e416b909
2 changed files with 4 additions and 4 deletions

View File

@ -69,8 +69,8 @@ def print_protocol():
True) True)
def main(): def main():
if len(sys.argv) != 2: if len(sys.argv) != 3:
print('Please specify the input file.') print('Usage: generate_protocol.py <input: protocol.hjson> <output: ProtocolDefinitions.h>')
return return
add_text('#pragma once') add_text('#pragma once')
@ -84,7 +84,7 @@ def main():
add_text('}}') add_text('}}')
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.write(text)
out_file.close() out_file.close()

View File

@ -1,4 +1,4 @@
protocol_headers = custom_target('ProtocolHeader', protocol_headers = custom_target('ProtocolHeader',
input : [ 'generate_protocol.py', 'protocol.hjson' ], input : [ 'generate_protocol.py', 'protocol.hjson' ],
output : [ 'ProtocolDefinitions.h' ], output : [ 'ProtocolDefinitions.h' ],
command : [ python, '@INPUT@' ]) command : [ python, '@INPUT@', '@OUTPUT@' ])