From aaf2525e9e8ed356feba437e56df737428a52f55 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 17 May 2017 15:13:58 +0200 Subject: Add ability to disable use of preprocessed output in compilation This can be done from a buildfile for a scope (including project root scope) and per target via cc.reprocess: cc.reprocess = true obj{hello}: cc.reprocess = false As as well externally via config.cc.reprocess: b config.cc.reprocess=true [configure] --- build2/cc/compile.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'build2/cc/compile.cxx') diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 32b5f6e..1eb4c9b 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -567,11 +567,14 @@ namespace build2 pair p (inject (act, t, lo, src, dd, u)); dd.close (); - // If the preprocessed output is suitable for compilation, pass it - // along. + // If the preprocessed output is suitable for compilation and is not + // disabled, pass it along. // - if (p.second) - md.psrc = move (p.first); + if (!p.first.path ().empty () && p.second) + { + if (!cast_false (t[c_reprocess])) + md.psrc = move (p.first); + } md.mt = u ? timestamp_nonexistent : mt; } -- cgit v1.1