commandline.scons 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. # Commandline options
  2. # To build updater-related targets, you need to set this option
  3. AddOption(
  4. "--with-updater",
  5. dest="fullenv",
  6. action="store_true",
  7. help="Full firmware environment",
  8. )
  9. AddOption(
  10. "--options",
  11. dest="optionfile",
  12. type="string",
  13. nargs=1,
  14. action="store",
  15. default="fbt_options.py",
  16. help="Enviroment option file",
  17. )
  18. AddOption(
  19. "--extra-int-apps",
  20. action="store",
  21. dest="extra_int_apps",
  22. default="",
  23. help="List of applications to add to firmare's built-ins. Also see FIRMWARE_APP_SET and FIRMWARE_APPS",
  24. )
  25. AddOption(
  26. "--extra-ext-apps",
  27. action="store",
  28. dest="extra_ext_apps",
  29. default="",
  30. help="List of applications to forcefully build as standalone .elf",
  31. )
  32. AddOption(
  33. "--proxy-env",
  34. action="store",
  35. dest="proxy_env",
  36. default="",
  37. help="Comma-separated list of additional environment variables to pass to child SCons processes",
  38. )
  39. # Construction environment variables
  40. vars = Variables(GetOption("optionfile"), ARGUMENTS)
  41. vars.AddVariables(
  42. BoolVariable(
  43. "VERBOSE",
  44. help="Print full commands",
  45. default=False,
  46. ),
  47. BoolVariable(
  48. "FORCE",
  49. help="Force target action (for supported targets)",
  50. default=False,
  51. ),
  52. BoolVariable(
  53. "DEBUG",
  54. help="Enable debug build",
  55. default=True,
  56. ),
  57. BoolVariable(
  58. "COMPACT",
  59. help="Optimize for size",
  60. default=False,
  61. ),
  62. EnumVariable(
  63. "TARGET_HW",
  64. help="Hardware target",
  65. default="7",
  66. allowed_values=[
  67. "7",
  68. ],
  69. ),
  70. BoolVariable(
  71. "DEBUG_TOOLS",
  72. help="Enable debug tools to be built",
  73. default=False,
  74. ),
  75. )
  76. vars.Add(
  77. "DIST_SUFFIX",
  78. help="Suffix for binaries in build output for dist targets",
  79. default="local",
  80. )
  81. vars.Add(
  82. "UPDATE_VERSION_STRING",
  83. help="Version string for updater package",
  84. default="${DIST_SUFFIX}",
  85. )
  86. vars.Add(
  87. "COPRO_CUBE_VERSION",
  88. help="Cube version",
  89. default="",
  90. )
  91. vars.Add(
  92. "COPRO_STACK_ADDR",
  93. help="Core2 Firmware address",
  94. default="0",
  95. )
  96. vars.Add(
  97. "COPRO_STACK_BIN",
  98. help="Core2 Firmware file name",
  99. default="",
  100. )
  101. vars.Add(
  102. "COPRO_DISCLAIMER",
  103. help="Value to pass to bundling script to confirm dangerous operations",
  104. default="",
  105. )
  106. vars.AddVariables(
  107. PathVariable(
  108. "COPRO_OB_DATA",
  109. help="Path to OB reference data",
  110. validator=PathVariable.PathIsFile,
  111. default="",
  112. ),
  113. PathVariable(
  114. "COPRO_STACK_BIN_DIR",
  115. help="Path to ST-provided stacks",
  116. validator=PathVariable.PathIsDir,
  117. default="",
  118. ),
  119. PathVariable(
  120. "COPRO_CUBE_DIR",
  121. help="Path to Cube root",
  122. validator=PathVariable.PathIsDir,
  123. default="",
  124. ),
  125. EnumVariable(
  126. "COPRO_STACK_TYPE",
  127. help="Core2 stack type",
  128. default="ble_light",
  129. allowed_values=[
  130. "ble_full",
  131. "ble_light",
  132. "ble_basic",
  133. ],
  134. ),
  135. PathVariable(
  136. "SVD_FILE",
  137. help="Path to SVD file",
  138. validator=PathVariable.PathIsFile,
  139. default="",
  140. ),
  141. PathVariable(
  142. "OTHER_ELF",
  143. help="Path to prebuilt ELF file to debug",
  144. validator=PathVariable.PathAccept,
  145. default="",
  146. ),
  147. )
  148. vars.Add(
  149. "FBT_TOOLCHAIN_VERSIONS",
  150. help="Whitelisted toolchain versions (leave empty for no check)",
  151. default=tuple(),
  152. )
  153. vars.Add(
  154. "OPENOCD_OPTS",
  155. help="Options to pass to OpenOCD",
  156. default="",
  157. )
  158. vars.Add(
  159. "BLACKMAGIC",
  160. help="Blackmagic probe location",
  161. default="auto",
  162. )
  163. vars.Add(
  164. "UPDATE_SPLASH",
  165. help="Directory name with slideshow frames to render after installing update package",
  166. default="update_default",
  167. )
  168. vars.Add(
  169. "LOADER_AUTOSTART",
  170. help="Application name to automatically run on Flipper boot",
  171. default="",
  172. )
  173. vars.Add(
  174. "FIRMWARE_APPS",
  175. help="Map of (configuration_name->application_list)",
  176. default={
  177. "default": (
  178. # Svc
  179. "basic_services",
  180. # Apps
  181. "main_apps",
  182. "system_apps",
  183. # Settings
  184. "settings_apps",
  185. # Plugins
  186. # "basic_plugins",
  187. # Debug
  188. # "debug_apps",
  189. )
  190. },
  191. )
  192. vars.Add(
  193. "FIRMWARE_APP_SET",
  194. help="Application set to use from FIRMWARE_APPS",
  195. default="default",
  196. )
  197. vars.Add(
  198. "APPSRC",
  199. help="Application source directory for app to build & upload",
  200. default="",
  201. )
  202. # List of tuples (directory, add_to_global_include_path)
  203. vars.Add(
  204. "APPDIRS",
  205. help="Directories to search for firmware components & external apps",
  206. default=[
  207. ("applications", False),
  208. ("applications/services", True),
  209. ("applications/main", True),
  210. ("applications/settings", False),
  211. ("applications/system", False),
  212. ("applications/debug", False),
  213. ("applications/plugins", False),
  214. ("applications/examples", False),
  215. ("applications_user", False),
  216. ],
  217. )
  218. Return("vars")