aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-26 12:09:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-26 12:09:22 +0200
commit889104885bd8a8e5ee0a4bc83b26242912f1e18a (patch)
treed8cf7d3e41b2110c897c26cbda704aa879012ef6
parentb6a3ec9df2e597050e607e34671c0663366e37ea (diff)
If cc.reprocess is true, then also reprocess when extracting unit info
-rw-r--r--build2/cc/compile-rule.cxx8
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.