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