commandline.scons 5.5 KB

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