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)
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()

View File

@ -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@' ])