-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfirmware.scons
More file actions
64 lines (57 loc) · 1.94 KB
/
firmware.scons
File metadata and controls
64 lines (57 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Import("FW_ENV", "fw_build_meta")
ENV = FW_ENV
# Building initial C environment for libs
env = ENV.Clone(
tools=[
"fbt_apps",
"fbt_hwtarget",
"fbt_envhooks",
("compilation_db", {"COMPILATIONDB_COMSTR": "\tCDB\t${TARGET}"}),
],
# Core tool options
TARGETS_ROOT=Dir("#/targets"),
F_TARGET_HW="f${TARGET_HW}",
FW_BUILD_META=fw_build_meta,
# CDB options
COMPILATIONDB_USE_ABSPATH=False,
COMPILATIONDB_USE_BINARY_ABSPATH=True,
# Basic paths and directories
BUILD_DIR=fw_build_meta["build_dir"],
FW_FLAVOR=fw_build_meta["flavor"],
FIRMWARE_BUILD_CFG=fw_build_meta["type"],
IS_BASE_FIRMWARE=fw_build_meta["type"] == "firmware",
LIB_DIST_DIR=fw_build_meta["build_dir"].Dir("lib"),
LIBPATH=[
"${LIB_DIST_DIR}",
],
# Default optimization and debug settings. You can override them with a module in `lib_modules`.
CPPDEF_FURI_DEBUG="FURI_DEBUG" if ENV["DEBUG"] else "FURI_NDEBUG",
CPPDEF_DEBUG="DEBUG" if ENV["DEBUG"] else "NDEBUG",
OPTIMIZATION="-Os" if ENV["COMPACT"] else "-Og",
# Per-library options. These are the defaults.
FW_LIB_OPTS={
# You can add other entries named after libraries.
# If they are present, they have precedence over Default.
# Note that you must specify both CCFLAGS and CPPDEFINES, even if they are same as Default.
"Default": {
"CCFLAGS": [
"${OPTIMIZATION}",
],
"CPPDEFINES": [
"${CPPDEF_DEBUG}",
"${CPPDEF_FURI_DEBUG}",
],
}
},
CPPDEFINES=GetOption("extra_defines"),
# Firmware environment must return its own list of artifacts for the
# dist environment via this variable
FW_ARTIFACTS=[],
)
Export("env")
env.PreConfigureFwEnvionment()
env.ConfigureForTarget()
env.ConfigureFwEnvWithLibraries()
env.ConfigureFwEnvComponents()
env.PostConfigureFwEnvionment()
Return("env")