@@ -228,21 +228,23 @@ def generate_uf2(target, source, env):
228
228
is_arduino_pico_build = env .BoardConfig ().get ("build.core" , "arduino" ) == "earlephilhower" and "arduino" in env .get ("PIOFRAMEWORK" )
229
229
target_gen_header = None
230
230
if is_arduino_pico_build :
231
- header_file = join (env .subst ("$BUILD_DIR" ), "core" , "Updater_Signing.h" )
232
- env .Prepend (CFLAGS = ['-I"%s"' % join ("$BUILD_DIR" , "core" )])
233
- signing_header_cmd = env .Command (
234
- join ("$BUILD_DIR" , "core" , "Updater_Signing.h" ), # $TARGET
235
- join ("$PROJECT_SRC_DIR" , "public.key" ), # $SOURCE
236
- env .VerboseAction (" " .join ([
237
- '"$PYTHONEXE" "%s"' % join (
238
- platform .get_package_dir ("framework-arduinopico" ), "tools" , "signing.py" ),
239
- "--mode" , "header" ,
240
- "--publickey" , '"$SOURCE"' ,
241
- "--out" , "$TARGET"
242
- ]), "Generating $TARGET" )
243
- )
244
- target_gen_header = env .Alias ("gen_header" , signing_header_cmd )
245
- AlwaysBuild (target_gen_header )
231
+ pubkey = join (env .subst ("$PROJECT_SRC_DIR" ), "public.key" )
232
+ if isfile (pubkey ):
233
+ header_file = join (env .subst ("$BUILD_DIR" ), "core" , "Updater_Signing.h" )
234
+ env .Prepend (CFLAGS = ['-I"%s"' % join ("$BUILD_DIR" , "core" )])
235
+ signing_header_cmd = env .Command (
236
+ join ("$BUILD_DIR" , "core" , "Updater_Signing.h" ), # $TARGET
237
+ join ("$PROJECT_SRC_DIR" , "public.key" ), # $SOURCE
238
+ env .VerboseAction (" " .join ([
239
+ '"$PYTHONEXE" "%s"' % join (
240
+ platform .get_package_dir ("framework-arduinopico" ), "tools" , "signing.py" ),
241
+ "--mode" , "header" ,
242
+ "--publickey" , '"$SOURCE"' ,
243
+ "--out" , "$TARGET"
244
+ ]), "Generating $TARGET" )
245
+ )
246
+ target_gen_header = env .Alias ("gen_header" , signing_header_cmd )
247
+ AlwaysBuild (target_gen_header )
246
248
247
249
#
248
250
# Target: Build executable and linkable firmware
0 commit comments