waf: add option --no-submodule-update

That is useful when the user wants to build with one or more submodules at a
specific revision. In case of a developer, that is useful for when a submodule
is in modification process and she needs to (constantly) test the build.
This commit is contained in:
Gustavo Jose de Sousa 2016-02-19 16:44:32 +00:00 committed by Lucas De Marchi
parent 9bb039accd
commit 3566052d6a
1 changed files with 14 additions and 3 deletions

11
wscript
View File

@ -54,6 +54,13 @@ def options(opt):
action='store_true',
help='Output all test programs')
g.add_option('--no-submodule-update',
dest='submodule_update',
action='store_false',
default=True,
help='Don\'t update git submodules. Useful for building ' +
'with submodules at specific revisions.')
def configure(cfg):
cfg.env.BOARD = cfg.options.board
# use a different variant for each board
@ -97,6 +104,9 @@ def configure(cfg):
'SKETCHBOOK="' + cfg.srcnode.abspath() + '"',
])
if cfg.options.submodule_update:
cfg.env.SUBMODULE_UPDATE = [True]
def collect_dirs_to_recurse(bld, globs, **kw):
dirs = []
globs = Utils.to_list(globs)
@ -198,6 +208,7 @@ def build(bld):
_build_cmd_tweaks(bld)
if bld.env.SUBMODULE_UPDATE:
bld.add_group('git_submodules')
for name in bld.env.GIT_SUBMODULES:
bld.git_submodule(name)