Import("ENV") from fbt.appmanifest import FlipperAppType appenv = ENV.Clone(tools=["fbt_extapps"]) appenv.Replace( LINKER_SCRIPT="application-ext", STRIPFLAGS=[ "--strip-debug", "--strip-unneeded", "-d", "-g", "-S", ], ) appenv.AppendUnique( CCFLAGS=[ "-Os", "-ggdb3", "-mword-relocations", "-mlong-calls", "-fno-common", "-nostdlib", "-fvisibility=hidden", ], LINKFLAGS=[ "-r", "-s", # "-Bsymbolic", "-nostartfiles", "-mlong-calls", "-fno-common", "-nostdlib", "-Wl,--gc-sections", "-Wl,--no-export-dynamic", "-fvisibility=hidden", "-Wl,-e${APP_ENTRY}", "-Xlinker", "-Map=${TARGET}.map", ], ) extapps = [] for apptype in (FlipperAppType.PLUGIN, FlipperAppType.EXTERNAL): for app in appenv["APPBUILD"].get_apps_of_type(apptype): extapps.append(appenv.BuildAppElf(app)) # Ugly access to global option if extra_app_list := GetOption("extra_ext_apps"): for extra_app in extra_app_list.split(","): extapps.append(appenv.BuildAppElf(appenv["APPMGR"].get(extra_app))) Alias(appenv["FIRMWARE_BUILD_CFG"] + "_extapps", extapps) Return("extapps")