mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-31 09:15:13 +00:00
waflib: subproject: preserve IGNORED_SUBDIRS between contexts, fix broken logic
This commit is contained in:
parent
fe14a360b4
commit
c9b5332d16
@ -18,7 +18,6 @@ Usage::
|
|||||||
from waflib import Configure, Logs, Options, Utils
|
from waflib import Configure, Logs, Options, Utils
|
||||||
import os
|
import os
|
||||||
|
|
||||||
IGNORED_SUBDIRS = []
|
|
||||||
DEPTH = ''
|
DEPTH = ''
|
||||||
|
|
||||||
def depth_push(path):
|
def depth_push(path):
|
||||||
@ -94,22 +93,19 @@ def get_subproject_env(ctx, path, log=False):
|
|||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
if conf.options.SKIP_SUBDIRS:
|
if conf.options.SKIP_SUBDIRS:
|
||||||
global IGNORED_SUBDIRS
|
conf.env.IGNORED_SUBDIRS = conf.options.SKIP_SUBDIRS.split(',')
|
||||||
IGNORED_SUBDIRS += conf.options.SKIP_SUBDIRS.split(',')
|
|
||||||
print(IGNORED_SUBDIRS)
|
|
||||||
|
|
||||||
@Configure.conf
|
@Configure.conf
|
||||||
def add_subproject(ctx, names):
|
def add_subproject(ctx, names):
|
||||||
global IGNORED_SUBDIRS
|
|
||||||
names_lst = Utils.to_list(names)
|
names_lst = Utils.to_list(names)
|
||||||
|
|
||||||
if isinstance(ctx, Configure.ConfigurationContext):
|
if isinstance(ctx, Configure.ConfigurationContext):
|
||||||
for name in names_lst:
|
for name in names_lst:
|
||||||
depth_push(name)
|
depth_push(name)
|
||||||
if name in IGNORED_SUBDIRS:
|
if name in ctx.env.IGNORED_SUBDIRS:
|
||||||
ctx.msg(msg='--X %s' % depth(), result='ignored', color='YELLOW')
|
ctx.msg(msg='--X %s' % depth(), result='ignored', color='YELLOW')
|
||||||
depth_pop()
|
depth_pop()
|
||||||
return
|
continue
|
||||||
saveenv = ctx.env
|
saveenv = ctx.env
|
||||||
ctx.setenv(name, ctx.env) # derive new env from previous
|
ctx.setenv(name, ctx.env) # derive new env from previous
|
||||||
ctx.env.ENVNAME = name
|
ctx.env.ENVNAME = name
|
||||||
@ -123,8 +119,8 @@ def add_subproject(ctx, names):
|
|||||||
if not ctx.all_envs:
|
if not ctx.all_envs:
|
||||||
ctx.load_envs()
|
ctx.load_envs()
|
||||||
for name in names_lst:
|
for name in names_lst:
|
||||||
if name in IGNORED_SUBDIRS:
|
if name in ctx.env.IGNORED_SUBDIRS:
|
||||||
return
|
continue
|
||||||
saveenv = ctx.env
|
saveenv = ctx.env
|
||||||
ctx.env = ctx.all_envs[name]
|
ctx.env = ctx.all_envs[name]
|
||||||
ctx.recurse(name)
|
ctx.recurse(name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user