From 542ad9696f50e33fa20e735c14c052720c55bc3a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 14:35:53 +0200 Subject: dry_run --- build2/cc/link-rule.cxx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'build2/cc/link-rule.cxx') diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index 9980fa3..bfc31d7 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -1749,6 +1749,8 @@ namespace build2 const file& t (xt.as ()); const path& tp (t.path ()); + context& ctx (t.ctx); + const scope& bs (t.base_scope ()); const scope& rs (*bs.root_scope ()); @@ -1868,7 +1870,7 @@ namespace build2 if (verb >= 3) print_process (args); - if (!dry_run) + if (!ctx.dry_run) { auto_rmfile rm (of); @@ -1968,7 +1970,7 @@ namespace build2 const string& cs ( cast ( rs[tsys == "win32-msvc" - ? t.ctx.var_pool["bin.ld.checksum"] + ? ctx.var_pool["bin.ld.checksum"] : x_checksum])); if (dd.expect (cs) != nullptr) @@ -2728,7 +2730,7 @@ namespace build2 // auto_rmfile rm; - if (!dry_run) + if (!ctx.dry_run) { rm = auto_rmfile (relt); @@ -2825,7 +2827,7 @@ namespace build2 if (verb >= 2) print_process (args); - if (!dry_run) + if (!ctx.dry_run) run (rl, args); } @@ -2845,12 +2847,12 @@ namespace build2 // For shared libraries we may need to create a bunch of symlinks (or // fallback to hardlinks/copies on Windows). // - auto ln = [] (const path& f, const path& l) + auto ln = [&ctx] (const path& f, const path& l) { if (verb >= 3) text << "ln -sf " << f << ' ' << l; - if (dry_run) + if (ctx.dry_run) return; try @@ -2910,12 +2912,12 @@ namespace build2 // if (tsys == "darwin" && cast (rs["bin.ar.id"]) == "generic") { - if (!dry_run) - touch (tp, false /* create */, verb_never); + if (!ctx.dry_run) + touch (ctx, tp, false /* create */, verb_never); } } - if (!dry_run) + if (!ctx.dry_run) { rm.cancel (); dd.check_mtime (tp); -- cgit v1.1