commandline.scons 4.8 KB

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