commandline.scons 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. )
  64. vars.Add(
  65. "DIST_SUFFIX",
  66. help="Suffix for binaries in build output for dist targets",
  67. default="local",
  68. )
  69. vars.Add(
  70. "UPDATE_VERSION_STRING",
  71. help="Version string for updater package",
  72. default="${DIST_SUFFIX}",
  73. )
  74. vars.Add(
  75. "COPRO_CUBE_VERSION",
  76. help="Cube version",
  77. default="",
  78. )
  79. vars.Add(
  80. "COPRO_STACK_ADDR",
  81. help="Core2 Firmware address",
  82. default="0",
  83. )
  84. vars.Add(
  85. "COPRO_STACK_BIN",
  86. help="Core2 Firmware file name",
  87. default="",
  88. )
  89. vars.Add(
  90. "COPRO_DISCLAIMER",
  91. help="Value to pass to bundling script to confirm dangerous operations",
  92. default="",
  93. )
  94. vars.AddVariables(
  95. PathVariable(
  96. "COPRO_OB_DATA",
  97. help="Path to OB reference data",
  98. validator=PathVariable.PathIsFile,
  99. default="",
  100. ),
  101. PathVariable(
  102. "COPRO_STACK_BIN_DIR",
  103. help="Path to ST-provided stacks",
  104. validator=PathVariable.PathIsDir,
  105. default="",
  106. ),
  107. PathVariable(
  108. "COPRO_CUBE_DIR",
  109. help="Path to Cube root",
  110. validator=PathVariable.PathIsDir,
  111. default="",
  112. ),
  113. EnumVariable(
  114. "COPRO_STACK_TYPE",
  115. help="Core2 stack type",
  116. default="ble_light",
  117. allowed_values=[
  118. "ble_full",
  119. "ble_light",
  120. "ble_basic",
  121. ],
  122. ),
  123. PathVariable(
  124. "SVD_FILE",
  125. help="Path to SVD file",
  126. validator=PathVariable.PathIsFile,
  127. default="",
  128. ),
  129. PathVariable(
  130. "OTHER_ELF",
  131. help="Path to prebuilt ELF file to debug",
  132. validator=PathVariable.PathAccept,
  133. default="",
  134. ),
  135. )
  136. vars.Add(
  137. "FBT_TOOLCHAIN_VERSIONS",
  138. help="Whitelisted toolchain versions (leave empty for no check)",
  139. default=tuple(),
  140. )
  141. vars.Add(
  142. "OPENOCD_OPTS",
  143. help="Options to pass to OpenOCD",
  144. default="",
  145. )
  146. vars.Add(
  147. "UPDATE_SPLASH",
  148. help="Directory name with slideshow frames to render after installing update package",
  149. default="update_default",
  150. )
  151. vars.Add(
  152. "FIRMWARE_APPS",
  153. help="Map of (configuration_name->application_list)",
  154. default={
  155. "default": (
  156. "crypto_start",
  157. # Svc
  158. "basic_services",
  159. # Apps
  160. "basic_apps",
  161. "updater_app",
  162. "archive",
  163. # Settings
  164. "passport",
  165. "system_settings",
  166. "about",
  167. # Plugins
  168. "basic_plugins",
  169. # Debug
  170. "debug_apps",
  171. )
  172. },
  173. )
  174. vars.Add(
  175. "FIRMWARE_APP_SET",
  176. help="Application set to use from FIRMWARE_APPS",
  177. default="default",
  178. )
  179. Return("vars")