fbt fixes for mfbt pt2 (#1951)
* fbt: split sdk management code * scripts: fixed import handling * fbt: sdk: reformatted paths * scrips: dist: bundling libs as a build artifact * fbt: sdk: better path management * typo fix * fbt: sdk: minor path handling fixes * toolchain: fixed windows toolchain download * fbt: minor refactorin * fbt: moved sdk management code to extapps.scons * fbt: fixed sdk symbols header path; disabled -fstack-usage * fbt: changed pathing for .py scripts * fbt: changed SDK_HEADERS pathing; added libusb to SDK; added icon_i.h to SDK; added hw target to SDK meta * fbt: added libusb headers to SDK * picopass: include cleanup; api: added subghz/registry.h; api: added mbedtls to exported headers * picopass: fixed formatting * fbt: fixed COPRO_ASSETS_SCRIPT * sdk: added basic infrared apis * toolchain: added ufbt to list of legal fbtenv callers; updated error messages * fbt: changed manifest collection & icon processing code * fbt: simpler srcdir lookup * toolchain: path management fixes; fbt: fixes for fap private libs paths * scripts: toolchain: reworked download on Windows * toolchain: v17 * scripts: added colorlog for logging * Github: fix unit tests Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -30,10 +30,9 @@ ENV.AppendUnique(
|
||||
"-ffunction-sections",
|
||||
"-fsingle-precision-constant",
|
||||
"-fno-math-errno",
|
||||
"-fstack-usage",
|
||||
# Generates .su files with stack usage information
|
||||
# "-fstack-usage",
|
||||
"-g",
|
||||
# "-Wno-stringop-overread",
|
||||
# "-Wno-stringop-overflow",
|
||||
],
|
||||
CPPDEFINES=[
|
||||
"_GNU_SOURCE",
|
||||
|
@@ -1,5 +1,10 @@
|
||||
from SCons.Platform import TempFileMunge
|
||||
from fbt.util import tempfile_arg_esc_func, single_quote, wrap_tempfile
|
||||
from fbt.util import (
|
||||
tempfile_arg_esc_func,
|
||||
single_quote,
|
||||
wrap_tempfile,
|
||||
extract_abs_dir_path,
|
||||
)
|
||||
|
||||
import os
|
||||
import multiprocessing
|
||||
@@ -52,6 +57,12 @@ coreenv = VAR_ENV.Clone(
|
||||
MAXLINELENGTH=2048,
|
||||
PROGSUFFIX=".elf",
|
||||
ENV=forward_os_env,
|
||||
SINGLEQUOTEFUNC=single_quote,
|
||||
ABSPATHGETTERFUNC=extract_abs_dir_path,
|
||||
# Setting up temp file parameters - to overcome command line length limits
|
||||
TEMPFILEARGESCFUNC=tempfile_arg_esc_func,
|
||||
FBT_SCRIPT_DIR=Dir("#/scripts"),
|
||||
ROOT_DIR=Dir("#"),
|
||||
)
|
||||
|
||||
# If DIST_SUFFIX is set in environment, is has precedence (set by CI)
|
||||
@@ -60,24 +71,6 @@ if os_suffix := os.environ.get("DIST_SUFFIX", None):
|
||||
DIST_SUFFIX=os_suffix,
|
||||
)
|
||||
|
||||
# print(coreenv.Dump())
|
||||
if not coreenv["VERBOSE"]:
|
||||
coreenv.SetDefault(
|
||||
CCCOMSTR="\tCC\t${SOURCE}",
|
||||
CXXCOMSTR="\tCPP\t${SOURCE}",
|
||||
ASCOMSTR="\tASM\t${SOURCE}",
|
||||
ARCOMSTR="\tAR\t${TARGET}",
|
||||
RANLIBCOMSTR="\tRANLIB\t${TARGET}",
|
||||
LINKCOMSTR="\tLINK\t${TARGET}",
|
||||
INSTALLSTR="\tINSTALL\t${TARGET}",
|
||||
APPSCOMSTR="\tAPPS\t${TARGET}",
|
||||
VERSIONCOMSTR="\tVERSION\t${TARGET}",
|
||||
STRIPCOMSTR="\tSTRIP\t${TARGET}",
|
||||
OBJDUMPCOMSTR="\tOBJDUMP\t${TARGET}",
|
||||
# GDBCOMSTR="\tGDB\t${SOURCE}",
|
||||
# GDBPYCOMSTR="\tGDB-PY\t${SOURCE}",
|
||||
)
|
||||
|
||||
# Default value for commandline options
|
||||
|
||||
SetOption("num_jobs", multiprocessing.cpu_count())
|
||||
@@ -90,12 +83,7 @@ SetOption("max_drift", 1)
|
||||
# Random task queue - to discover isses with build logic faster
|
||||
# SetOption("random", 1)
|
||||
|
||||
|
||||
# Setting up temp file parameters - to overcome command line length limits
|
||||
coreenv["TEMPFILEARGESCFUNC"] = tempfile_arg_esc_func
|
||||
wrap_tempfile(coreenv, "LINKCOM")
|
||||
wrap_tempfile(coreenv, "ARCOM")
|
||||
|
||||
coreenv["SINGLEQUOTEFUNC"] = single_quote
|
||||
|
||||
Return("coreenv")
|
||||
|
@@ -3,10 +3,9 @@ from SCons.Errors import UserError
|
||||
|
||||
Import("ENV")
|
||||
|
||||
|
||||
from fbt.appmanifest import FlipperAppType
|
||||
|
||||
appenv = ENV.Clone(
|
||||
appenv = ENV["APPENV"] = ENV.Clone(
|
||||
tools=[
|
||||
(
|
||||
"fbt_extapps",
|
||||
@@ -17,6 +16,7 @@ appenv = ENV.Clone(
|
||||
},
|
||||
),
|
||||
"fbt_assets",
|
||||
"fbt_sdk",
|
||||
]
|
||||
)
|
||||
|
||||
@@ -66,6 +66,7 @@ extapps = appenv["_extapps"] = {
|
||||
"validators": {},
|
||||
"dist": {},
|
||||
"resources_dist": None,
|
||||
"sdk_tree": None,
|
||||
}
|
||||
|
||||
|
||||
@@ -115,10 +116,41 @@ if appsrc := appenv.subst("$APPSRC"):
|
||||
app_manifest, fap_file, app_validator = appenv.GetExtAppFromPath(appsrc)
|
||||
appenv.PhonyTarget(
|
||||
"launch_app",
|
||||
'${PYTHON3} scripts/runfap.py ${SOURCE} --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"',
|
||||
'${PYTHON3} "${APP_RUN_SCRIPT}" ${SOURCE} --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"',
|
||||
source=fap_file,
|
||||
FAP_CATEGORY=app_manifest.fap_category,
|
||||
)
|
||||
appenv.Alias("launch_app", app_validator)
|
||||
|
||||
# SDK management
|
||||
|
||||
sdk_origin_path = "${BUILD_DIR}/sdk_origin"
|
||||
sdk_source = appenv.SDKPrebuilder(
|
||||
sdk_origin_path,
|
||||
# Deps on root SDK headers and generated files
|
||||
(appenv["SDK_HEADERS"], appenv["FW_ASSETS_HEADERS"]),
|
||||
)
|
||||
# Extra deps on headers included in deeper levels
|
||||
Depends(sdk_source, appenv.ProcessSdkDepends(f"{sdk_origin_path}.d"))
|
||||
|
||||
appenv["SDK_DIR"] = appenv.Dir("${BUILD_DIR}/sdk")
|
||||
sdk_tree = extapps["sdk_tree"] = appenv.SDKTree(appenv["SDK_DIR"], sdk_origin_path)
|
||||
# AlwaysBuild(sdk_tree)
|
||||
Alias("sdk_tree", sdk_tree)
|
||||
|
||||
sdk_apicheck = appenv.SDKSymUpdater(appenv["SDK_DEFINITION"], sdk_origin_path)
|
||||
Precious(sdk_apicheck)
|
||||
NoClean(sdk_apicheck)
|
||||
AlwaysBuild(sdk_apicheck)
|
||||
Alias("sdk_check", sdk_apicheck)
|
||||
|
||||
sdk_apisyms = appenv.SDKSymGenerator(
|
||||
"${BUILD_DIR}/assets/compiled/symbols.h", appenv["SDK_DEFINITION"]
|
||||
)
|
||||
Alias("api_syms", sdk_apisyms)
|
||||
|
||||
if appenv["FORCE"]:
|
||||
appenv.AlwaysBuild(sdk_source, sdk_tree, sdk_apicheck, sdk_apisyms)
|
||||
|
||||
|
||||
Return("extapps")
|
||||
|
Reference in New Issue
Block a user