From 41c4dfa0bcc2077460d6178c53861893c7eb7b0c Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Thu, 22 Oct 2020 13:40:10 +0200 Subject: [PATCH] meson.build: Make radio_tool and objcopy optional --- meson.build | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/meson.build b/meson.build index 93727bbf..12d8664b 100644 --- a/meson.build +++ b/meson.build @@ -180,23 +180,27 @@ foreach t : targets if t['flashable'] - bin = custom_target(name+'_bin', - output : name+'_bin', - input : exe, - command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@']) + if objcopy.found() + bin = custom_target(name+'_bin', + output : name+'_bin', + input : exe, + command : [objcopy, '-O', 'binary', '@INPUT@', '@OUTPUT@']) - wrap = custom_target(name+'_wrap', - output : name+'_wrap', - input : bin, - command : [radio_tool, - '--wrap', - '-o', '@OUTPUT@', - '-r', t['wrap'], - '-s', t['load_addr']+':@INPUT@']) + 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@']) - custom_target(name+'_flash', - input : wrap, - output : name+'_flash', - command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@']) + custom_target(name+'_flash', + input : wrap, + output : name+'_flash', + command : [radio_tool, '-d', '0', '-f', '-i', '@INPUT@']) + endif + endif endif endforeach