meson.build: use bin2sgl python script

Resolve #344
This commit is contained in:
Peter Buchegger 2025-09-09 20:53:18 +02:00 committed by Silvano Seva
parent 7f3991b8f1
commit 4b1e2943c9
1 changed files with 8 additions and 23 deletions

View File

@ -906,15 +906,8 @@ targets = [
},
]
if build_machine.system() == 'linux'
bin2sgl = find_program('scripts/bin2sgl.Linux', required:false, disabler:true)
elif build_machine.system() == 'windows'
bin2sgl = find_program('scripts/bin2sgl.exe', required:false, disabler:true)
elif build_machine.system() == 'darwin'
bin2sgl = find_program('scripts/bin2sgl.Darwin', required:false, disabler:true)
endif
radio_tool = find_program('radio_tool')
bin2sgl = find_program('scripts/bin2sgl.py', required:false, disabler:true)
objcopy = find_program('objcopy', required:false, disabler:true)
gd77_loader = find_program('scripts/gd-77_firmware_loader.py', required:false, disabler:true)
dfu_util = find_program('dfu-util', required:false, disabler:true)
@ -993,21 +986,13 @@ foreach t : targets
# Handle GD77 custom wrapping and flashing tools
if name == 'openrtx_gd77' or name == 'openrtx_dm1801'
if build_machine.system() == 'windows'
wrap = custom_target(name+'_wrap',
output : name+'_bin.sgl',
input : bin,
command : [bin2sgl, '@INPUT@', '-m', t['wrap']])
else # Unix-like OS that has mv
wrap = custom_target(name+'_wrap',
output : name+'_wrap.sgl',
input : bin,
command : [bin2sgl,
'-f', '@INPUT@',
'-m', t['wrap'],
'&&',
'mv', '@INPUT@.sgl', '@OUTPUT@'])
endif
'--in', '@INPUT@',
'--out', '@OUTPUT@',
'--mode', t['wrap']])
custom_target(name+'_flash',
input : wrap,