flipperzero-firmware/lib/toolbox/SConscript
hedger ebc2b66372
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>
2022-11-03 00:15:40 +09:00

68 lines
1.6 KiB
Python

Import("env")
from fbt.version import get_fast_git_version_id
env.Append(
CPPPATH=[
"#/lib/toolbox",
],
SDK_HEADERS=[
File("manchester_decoder.h"),
File("manchester_encoder.h"),
File("path.h"),
File("random_name.h"),
File("hmac_sha256.h"),
File("crc32_calc.h"),
File("dir_walk.h"),
File("md5.h"),
File("args.h"),
File("saved_struct.h"),
File("version.h"),
File("tar/tar_archive.h"),
File("stream/stream.h"),
File("stream/file_stream.h"),
File("stream/string_stream.h"),
File("stream/buffered_file_stream.h"),
File("protocols/protocol_dict.h"),
],
)
libenv = env.Clone(tools=["fbt_version"], FW_LIB_NAME="toolbox")
libenv.ApplyLibFlags()
# Git Version management
version_depends = []
version_id_data = get_fast_git_version_id()
if version_id_data:
version_depends = Value(version_id_data)
# Only invoke version generator if preliminary check target (version_depends) has changed
build_version = libenv.VersionBuilder(
Dir("."),
version_depends,
)
fw_version_json = libenv.InstallAs(
"${BUILD_DIR}/${FIRMWARE_BUILD_CFG}.json", "version.json"
)
Alias("version_json", fw_version_json)
env.Append(FW_VERSION_JSON=fw_version_json)
# Default(fw_version_json)
if not version_depends:
libenv.Precious(build_version)
libenv.AlwaysBuild(build_version)
sources = libenv.GlobRecursive("*.c")
libenv.Append(CPPPATH=[libenv.Dir(".")])
lib = libenv.StaticLibrary("${FW_LIB_NAME}", sources)
libenv.Install("${LIB_DIST_DIR}", lib)
Return("lib")