[FL-2554] Embedded arm-none-eabi toolchain (#1351)

This commit is contained in:
Max Andreev
2022-07-14 19:24:26 +03:00
committed by GitHub
parent dbf1d9f332
commit fd498bdfcf
17 changed files with 332 additions and 35 deletions

View File

@@ -63,8 +63,13 @@ class AppManager:
nonlocal app_manifests
app_manifests.append(FlipperApplication(*args, **kw, _appdir=app_dir_name))
with open(app_manifest_path, "rt") as manifest_file:
exec(manifest_file.read())
try:
with open(app_manifest_path, "rt") as manifest_file:
exec(manifest_file.read())
except Exception as e:
raise FlipperManifestException(
f"Failed parsing manifest '{app_manifest_path}' : {e}"
)
if len(app_manifests) == 0:
raise FlipperManifestException(

View File

@@ -1,5 +1,6 @@
import SCons
from SCons.Subst import quote_spaces
from SCons.Errors import StopError
import re
import os
@@ -30,7 +31,7 @@ def link_dir(target_path, source_path, is_windows):
import _winapi
if not os.path.isdir(source_path):
raise Exception(f"Source directory {source_path} is not a directory")
raise StopError(f"Source directory {source_path} is not a directory")
if not os.path.exists(target_path):
_winapi.CreateJunction(source_path, target_path)

View File

@@ -1,3 +1,4 @@
from SCons.Errors import StopError
from SCons.Tool import asm
from SCons.Tool import gcc
from SCons.Tool import gxx
@@ -65,7 +66,7 @@ def generate(env, **kw):
# print("CC version =", cc_version)
# print(list(filter(lambda v: v in cc_version, whitelisted_versions)))
if not any(filter(lambda v: v in cc_version, whitelisted_versions)):
raise Exception(
raise StopError(
f"Toolchain version is not supported. Allowed: {whitelisted_versions}, toolchain: {cc_version} "
)

View File

@@ -1,8 +1,14 @@
from SCons.Builder import Builder
from SCons.Action import Action
from SCons.Errors import UserError
import SCons
from fbt.appmanifest import FlipperAppType, AppManager, ApplicationsCGenerator
from fbt.appmanifest import (
FlipperAppType,
AppManager,
ApplicationsCGenerator,
FlipperManifestException,
)
# Adding objects for application management to env
# AppManager env["APPMGR"] - loads all manifests; manages list of known apps
@@ -13,7 +19,10 @@ def LoadApplicationManifests(env):
appmgr = env["APPMGR"] = AppManager()
for entry in env.Glob("#/applications/*"):
if isinstance(entry, SCons.Node.FS.Dir) and not str(entry).startswith("."):
appmgr.load_manifest(entry.File("application.fam").abspath, entry.name)
try:
appmgr.load_manifest(entry.File("application.fam").abspath, entry.name)
except FlipperManifestException as e:
raise UserError(e)
def PrepareApplicationsBuild(env):