commandline.scons 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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="Environment 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 firmware'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. "LIB_DEBUG",
  59. help="Enable debug build for libraries",
  60. default=False,
  61. ),
  62. BoolVariable(
  63. "COMPACT",
  64. help="Optimize for size",
  65. default=False,
  66. ),
  67. EnumVariable(
  68. "TARGET_HW",
  69. help="Hardware target",
  70. default="7",
  71. allowed_values=[
  72. "7",
  73. ],
  74. ),
  75. BoolVariable(
  76. "DEBUG_TOOLS",
  77. help="Enable debug tools to be built",
  78. default=False,
  79. ),
  80. BoolVariable(
  81. "FAP_EXAMPLES",
  82. help="Enable example applications to be built",
  83. default=False,
  84. ),
  85. (
  86. "DIST_SUFFIX",
  87. "Suffix for binaries in build output for dist targets",
  88. "local",
  89. ),
  90. (
  91. "UPDATE_VERSION_STRING",
  92. "Version string for updater package",
  93. "${DIST_SUFFIX}",
  94. ),
  95. (
  96. "COPRO_CUBE_VERSION",
  97. "Cube version",
  98. "",
  99. ),
  100. (
  101. "COPRO_STACK_ADDR",
  102. "Core2 Firmware address",
  103. "0",
  104. ),
  105. (
  106. "COPRO_STACK_BIN",
  107. "Core2 Firmware file name",
  108. "",
  109. ),
  110. (
  111. "COPRO_DISCLAIMER",
  112. "Value to pass to bundling script to confirm dangerous operations",
  113. "",
  114. ),
  115. PathVariable(
  116. "COPRO_OB_DATA",
  117. help="Path to OB reference data",
  118. validator=PathVariable.PathIsFile,
  119. default="",
  120. ),
  121. PathVariable(
  122. "COPRO_STACK_BIN_DIR",
  123. help="Path to ST-provided stacks",
  124. validator=PathVariable.PathIsDir,
  125. default="",
  126. ),
  127. PathVariable(
  128. "COPRO_CUBE_DIR",
  129. help="Path to Cube root",
  130. validator=PathVariable.PathIsDir,
  131. default="",
  132. ),
  133. EnumVariable(
  134. "COPRO_STACK_TYPE",
  135. help="Core2 stack type",
  136. default="ble_light",
  137. allowed_values=[
  138. "ble_full",
  139. "ble_light",
  140. "ble_basic",
  141. ],
  142. ),
  143. PathVariable(
  144. "SVD_FILE",
  145. help="Path to SVD file",
  146. validator=PathVariable.PathAccept,
  147. default="",
  148. ),
  149. PathVariable(
  150. "OTHER_ELF",
  151. help="Path to prebuilt ELF file to debug",
  152. validator=PathVariable.PathAccept,
  153. default="",
  154. ),
  155. (
  156. "FBT_TOOLCHAIN_VERSIONS",
  157. "Whitelisted toolchain versions (leave empty for no check)",
  158. tuple(),
  159. ),
  160. (
  161. "OPENOCD_OPTS",
  162. "Options to pass to OpenOCD",
  163. "",
  164. ),
  165. (
  166. "BLACKMAGIC",
  167. "Blackmagic probe location",
  168. "auto",
  169. ),
  170. (
  171. "OPENOCD_ADAPTER_SERIAL",
  172. "OpenOCD adapter serial number",
  173. "auto",
  174. ),
  175. (
  176. "UPDATE_SPLASH",
  177. "Directory name with slideshow frames to render after installing update package",
  178. "update_default",
  179. ),
  180. (
  181. "LOADER_AUTOSTART",
  182. "Application name to automatically run on Flipper boot",
  183. "",
  184. ),
  185. (
  186. "FIRMWARE_APPS",
  187. "Map of (configuration_name->application_list)",
  188. {
  189. "default": (
  190. # Svc
  191. "basic_services",
  192. # Apps
  193. "main_apps",
  194. "system_apps",
  195. # Settings
  196. "settings_apps",
  197. # Plugins
  198. # "basic_plugins",
  199. # Debug
  200. # "debug_apps",
  201. )
  202. },
  203. ),
  204. (
  205. "FIRMWARE_APP_SET",
  206. "Application set to use from FIRMWARE_APPS",
  207. "default",
  208. ),
  209. (
  210. "APPSRC",
  211. "Application source directory for app to build & upload",
  212. "",
  213. ),
  214. # List of tuples (directory, add_to_global_include_path)
  215. (
  216. "APPDIRS",
  217. "Directories to search for firmware components & external apps",
  218. [
  219. ("applications", False),
  220. ("applications/services", True),
  221. ("applications/main", True),
  222. ("applications/settings", False),
  223. ("applications/system", False),
  224. ("applications/debug", False),
  225. ("applications/plugins", False),
  226. ("applications_user", False),
  227. ],
  228. ),
  229. )
  230. Return("vars")