Improve handling of missing radio_tool dependency
This commit is contained in:
parent
838490574e
commit
190548a0d0
40
meson.build
40
meson.build
|
|
@ -170,8 +170,8 @@ targets = [
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
objcopy = find_program('objcopy', required:false)
|
objcopy = find_program('objcopy', required:false, disabler:true)
|
||||||
radio_tool = find_program('radio_tool', required:false)
|
radio_tool = find_program('radio_tool', required:false, disabler:true)
|
||||||
|
|
||||||
foreach t : targets
|
foreach t : targets
|
||||||
|
|
||||||
|
|
@ -180,27 +180,23 @@ foreach t : targets
|
||||||
|
|
||||||
if t['flashable']
|
if t['flashable']
|
||||||
|
|
||||||
if objcopy.found()
|
bin = custom_target(name+'_bin',
|
||||||
bin = custom_target(name+'_bin',
|
output : name+'_bin',
|
||||||
output : name+'_bin',
|
input : exe,
|
||||||
input : exe,
|
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
|
||||||
command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@'])
|
|
||||||
|
|
||||||
if radio_tool.found()
|
wrap = custom_target(name+'_wrap',
|
||||||
wrap = custom_target(name+'_wrap',
|
output : name+'_wrap',
|
||||||
output : name+'_wrap',
|
input : bin,
|
||||||
input : bin,
|
command : [radio_tool,
|
||||||
command : [radio_tool,
|
'--wrap',
|
||||||
'--wrap',
|
'-o', '@OUTPUT@',
|
||||||
'-o', '@OUTPUT@',
|
'-r', t['wrap'],
|
||||||
'-r', t['wrap'],
|
'-s', t['load_addr']+':@INPUT@'])
|
||||||
'-s', t['load_addr']+':@INPUT@'])
|
|
||||||
|
|
||||||
custom_target(name+'_flash',
|
custom_target(name+'_flash',
|
||||||
input : wrap,
|
input : wrap,
|
||||||
output : name+'_flash',
|
output : name+'_flash',
|
||||||
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
|
command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@'])
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue