From 889104885bd8a8e5ee0a4bc83b26242912f1e18a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 26 Feb 2018 12:09:22 +0200 Subject: If cc.reprocess is true, then also reprocess when extracting unit info --- build2/cc/compile-rule.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx index 17f9b72..96b5029 100644 --- a/build2/cc/compile-rule.cxx +++ b/build2/cc/compile-rule.cxx @@ -2834,7 +2834,13 @@ namespace build2 bool ps; // True if extracting from psrc. if (md.pp < preprocessed::modules) { - ps = !psrc.path.empty (); + // If we were instructed to reprocess the source during compilation, + // then also reprocess it here. While the preprocessed output may be + // usable for our needs, to be safe we assume it is not (and later we + // may extend cc.reprocess to allow specifying where reprocessing is + // needed). + // + ps = !psrc.path.empty () && !cast_false (t[c_reprocess]); sp = &(ps ? psrc.path : src.path ()); // VC's preprocessed output, if present, is fully preprocessed. -- cgit v1.1