Improve handling of missing radio_tool dependency

replace/06321bb744999f0d447ba97d4af7bd80bb456970
Niccolò Izzo 2020-10-22 21:55:54 +02:00
rodzic 838490574e
commit 190548a0d0
1 zmienionych plików z 18 dodań i 22 usunięć

Wyświetl plik

@ -170,8 +170,8 @@ targets = [
]
objcopy = find_program('objcopy', required:false)
radio_tool = find_program('radio_tool', required:false)
objcopy = find_program('objcopy', required:false, disabler:true)
radio_tool = find_program('radio_tool', required:false, disabler:true)
foreach t : targets
@ -180,27 +180,23 @@ foreach t : targets
if t['flashable']
if objcopy.found()
bin = custom_target(name+'_bin',
output : name+'_bin',
input : exe,
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
bin = custom_target(name+'_bin',
output : name+'_bin',
input : exe,
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
if radio_tool.found()
wrap = custom_target(name+'_wrap',
output : name+'_wrap',
input : bin,
command : [radio_tool,
'--wrap',
'-o', '@OUTPUT@',
'-r', t['wrap'],
'-s', t['load_addr']+':@INPUT@'])
wrap = custom_target(name+'_wrap',
output : name+'_wrap',
input : bin,
command : [radio_tool,
'--wrap',
'-o', '@OUTPUT@',
'-r', t['wrap'],
'-s', t['load_addr']+':@INPUT@'])
custom_target(name+'_flash',
input : wrap,
output : name+'_flash',
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
endif
endif
custom_target(name+'_flash',
input : wrap,
output : name+'_flash',
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
endif
endforeach