commandline.scons 5.4 KB

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