From b0b773335c966d0b53f3edff2810e55a32ff9b3d Mon Sep 17 00:00:00 2001 From: Shawn Hoover Date: Wed, 30 Sep 2015 23:34:08 -0400 Subject: [PATCH] playground/c: update bld methods. Use write_config_header for variants so cleanall doesn't delete them. --- playground/c/wscript | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/playground/c/wscript b/playground/c/wscript index bff2be1a..7fad6c5f 100644 --- a/playground/c/wscript +++ b/playground/c/wscript @@ -26,13 +26,9 @@ def configure(conf): conf.check_cc(fragment="""#include\nint main(){fprintf(stderr, "mu"); printf("%d", 22);return 0;}\n""", execute=True, define_name='HAVE_MU') conf.write_config_header('config.h') - # gotcha - the config.h must be written for each variant - txt = conf.bldnode.search_node('config.h').read() for x in lst: - node = conf.bldnode.make_node(x + '/config.h') - node.parent.mkdir() - node.write(txt) + conf.write_config_header(x + '/config.h') from waflib import Utils, Build class buildall_ctx(Build.BuildContext): @@ -50,7 +46,7 @@ def buildall(ctx): class sub_build(Utils.threading.Thread): def run(self): bld = self.bld = self.cls(top_dir=ctx.top_dir, out_dir=ctx.out_dir) - bld.load() + bld.restore() bld.siblings = threads bld.count = count bld.line_lock = line_lock @@ -96,13 +92,13 @@ def cleanall(ctx): for x in lst: cls = type(Build.CleanContext)(x, (Build.CleanContext,), {'cmd': x, 'variant': x}) bld = cls(top_dir=ctx.top_dir, out_dir=ctx.out_dir) - bld.load() + bld.restore() bld.load_envs() bld.recurse([bld.run_dir]) try: bld.clean() finally: - bld.save() + bld.store() # produces dict/json compatible output