mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-22 01:46:15 +01:00
Reflect the current build group in bld.current_group
This commit is contained in:
parent
2b09852d9e
commit
29b32f7a1a
@ -41,9 +41,9 @@ def are_implicit_nodes_ready(self):
|
||||
bld.dct_implicit_nodes = cache = {}
|
||||
|
||||
try:
|
||||
dct = cache[bld.cur]
|
||||
dct = cache[bld.current_group]
|
||||
except KeyError:
|
||||
dct = cache[bld.cur] = {}
|
||||
dct = cache[bld.current_group] = {}
|
||||
for tsk in bld.cur_tasks:
|
||||
for x in tsk.outputs:
|
||||
dct[x] = tsk
|
||||
|
@ -716,11 +716,11 @@ class BuildContext(Context.Context):
|
||||
|
||||
def post_group(self):
|
||||
"""
|
||||
Post task generators from the group indexed by self.cur; used internally
|
||||
Post task generators from the group indexed by self.current_group; used internally
|
||||
by :py:meth:`waflib.Build.BuildContext.get_build_iterator`
|
||||
"""
|
||||
if self.targets == '*':
|
||||
for tg in self.groups[self.cur]:
|
||||
for tg in self.groups[self.current_group]:
|
||||
try:
|
||||
f = tg.post
|
||||
except AttributeError:
|
||||
@ -728,8 +728,8 @@ class BuildContext(Context.Context):
|
||||
else:
|
||||
f()
|
||||
elif self.targets:
|
||||
if self.cur < self._min_grp:
|
||||
for tg in self.groups[self.cur]:
|
||||
if self.current_group < self._min_grp:
|
||||
for tg in self.groups[self.current_group]:
|
||||
try:
|
||||
f = tg.post
|
||||
except AttributeError:
|
||||
@ -747,7 +747,7 @@ class BuildContext(Context.Context):
|
||||
elif not ln.is_child_of(self.srcnode):
|
||||
Logs.warn('CWD %s is not under %s, forcing --targets=* (run distclean?)', ln.abspath(), self.srcnode.abspath())
|
||||
ln = self.srcnode
|
||||
for tg in self.groups[self.cur]:
|
||||
for tg in self.groups[self.current_group]:
|
||||
try:
|
||||
f = tg.post
|
||||
except AttributeError:
|
||||
@ -778,25 +778,25 @@ class BuildContext(Context.Context):
|
||||
:return: tasks which can be executed immediately
|
||||
:rtype: generator returning lists of :py:class:`waflib.Task.Task`
|
||||
"""
|
||||
self.cur = 0
|
||||
self.current_group = 0
|
||||
|
||||
if self.targets and self.targets != '*':
|
||||
(self._min_grp, self._exact_tg) = self.get_targets()
|
||||
|
||||
global lazy_post
|
||||
if self.post_mode != POST_LAZY:
|
||||
while self.cur < len(self.groups):
|
||||
while self.current_group < len(self.groups):
|
||||
self.post_group()
|
||||
self.cur += 1
|
||||
self.cur = 0
|
||||
self.current_group += 1
|
||||
self.current_group = 0
|
||||
|
||||
while self.cur < len(self.groups):
|
||||
while self.current_group < len(self.groups):
|
||||
# first post the task generators for the group
|
||||
if self.post_mode != POST_AT_ONCE:
|
||||
self.post_group()
|
||||
|
||||
# then extract the tasks
|
||||
tasks = self.get_tasks_group(self.cur)
|
||||
tasks = self.get_tasks_group(self.current_group)
|
||||
# if the constraints are set properly (ext_in/ext_out, before/after)
|
||||
# the call to set_file_constraints may be removed (can be a 15% penalty on no-op rebuilds)
|
||||
# (but leave set_file_constraints for the installation step)
|
||||
@ -807,7 +807,7 @@ class BuildContext(Context.Context):
|
||||
Task.set_precedence_constraints(tasks)
|
||||
|
||||
self.cur_tasks = tasks
|
||||
self.cur += 1
|
||||
self.current_group += 1
|
||||
if not tasks: # return something else the build will stop
|
||||
continue
|
||||
yield tasks
|
||||
|
@ -797,9 +797,9 @@ class Task(evil):
|
||||
|
||||
# one cache per build group
|
||||
try:
|
||||
dct = cache[bld.cur]
|
||||
dct = cache[bld.current_group]
|
||||
except KeyError:
|
||||
dct = cache[bld.cur] = {}
|
||||
dct = cache[bld.current_group] = {}
|
||||
for tsk in bld.cur_tasks:
|
||||
for x in tsk.outputs:
|
||||
dct[x] = tsk
|
||||
|
@ -664,10 +664,10 @@ class xcode(Build.BuildContext):
|
||||
|
||||
# post all task generators
|
||||
# the process_xcode method above will be called for each target
|
||||
self.cur = 0
|
||||
while self.cur < len(self.groups):
|
||||
self.current_group = 0
|
||||
while self.current_group < len(self.groups):
|
||||
self.post_group()
|
||||
self.cur += 1
|
||||
self.current_group += 1
|
||||
|
||||
node = self.bldnode.make_node('%s.xcodeproj' % appname)
|
||||
node.mkdir()
|
||||
|
Loading…
Reference in New Issue
Block a user