mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
Tools: Support enabling scripting by default
This commit is contained in:
parent
4a4a91c662
commit
0e76afd22c
@ -43,6 +43,29 @@ class Board:
|
||||
env = waflib.ConfigSet.ConfigSet()
|
||||
self.configure_env(cfg, env)
|
||||
|
||||
# Setup scripting, had to defer this to allow checking board size
|
||||
if (not cfg.options.disable_scripting) and ((cfg.env.BOARD_FLASH_SIZE is None) or (cfg.env.BOARD_FLASH_SIZE == []) or (cfg.env.BOARD_FLASH_SIZE > 1024)):
|
||||
env.DEFINES.update(
|
||||
ENABLE_SCRIPTING = 1,
|
||||
ENABLE_HEAP = 1,
|
||||
LUA_32BITS = 1,
|
||||
)
|
||||
|
||||
env.ROMFS_FILES += [
|
||||
('sandbox.lua', 'libraries/AP_Scripting/scripts/sandbox.lua'),
|
||||
]
|
||||
|
||||
env.AP_LIBRARIES += [
|
||||
'AP_Scripting',
|
||||
'AP_Scripting/lua/src',
|
||||
]
|
||||
|
||||
env.CXXFLAGS += [
|
||||
'-DHAL_HAVE_AP_ROMFS_EMBEDDED_H'
|
||||
]
|
||||
else:
|
||||
cfg.options.disable_scripting = True;
|
||||
|
||||
d = env.get_merged_dict()
|
||||
# Always prepend so that arguments passed in the command line get
|
||||
# the priority.
|
||||
@ -97,26 +120,6 @@ class Board:
|
||||
'-Werror=format-extra-args',
|
||||
]
|
||||
|
||||
if cfg.options.enable_scripting:
|
||||
env.DEFINES.update(
|
||||
ENABLE_SCRIPTING = 1,
|
||||
ENABLE_HEAP = 1,
|
||||
LUA_32BITS = 1,
|
||||
)
|
||||
|
||||
env.ROMFS_FILES += [
|
||||
('sandbox.lua', 'libraries/AP_Scripting/scripts/sandbox.lua'),
|
||||
]
|
||||
|
||||
env.AP_LIBRARIES += [
|
||||
'AP_Scripting',
|
||||
'AP_Scripting/lua/src',
|
||||
]
|
||||
|
||||
env.CXXFLAGS += [
|
||||
'-DHAL_HAVE_AP_ROMFS_EMBEDDED_H'
|
||||
]
|
||||
|
||||
if cfg.options.scripting_checks:
|
||||
env.DEFINES.update(
|
||||
AP_SCRIPTING_CHECKS = 1,
|
||||
|
Loading…
Reference in New Issue
Block a user