From 190548a0d078175f5ff675366b64664118832bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Izzo?= Date: Thu, 22 Oct 2020 21:55:54 +0200 Subject: [PATCH] Improve handling of missing radio_tool dependency --- meson.build | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/meson.build b/meson.build index 12d8664b..e69f48b8 100644 --- a/meson.build +++ b/meson.build @@ -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