diff options
-rw-r--r-- | build2/cc/compile-rule.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
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<bool> (t[c_reprocess]); sp = &(ps ? psrc.path : src.path ()); // VC's preprocessed output, if present, is fully preprocessed. |