aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-24 16:35:21 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-24 16:35:21 +0200
commitcdddf131403120ca73c83fa8a63da6e71ab3dae4 (patch)
treea36e3bfb4a8f662fa004fd57e558d154921d5307 /libbuild2
parent78773876deea6da93b617d1d345913ae56c10883 (diff)
Omit ignorable change detection for header units
Since the checksum ignores preprocessor directives, this may cause us to ignore a change to an exported macro.
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/cc/compile-rule.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx
index ada0cc6..8e1cc81 100644
--- a/libbuild2/cc/compile-rule.cxx
+++ b/libbuild2/cc/compile-rule.cxx
@@ -5006,7 +5006,15 @@ namespace build2
// accurate (parts of the translation unit could have been
// #ifdef'ed out; see __build2_preprocess).
//
- return reprocess ? string () : move (p.checksum);
+ // Also, don't use the checksum for header units since it ignores
+ // preprocessor directives and may therefore cause us to ignore a
+ // change to an exported macro. @@ TODO: maybe we should add a
+ // flag to the parser not to waste time calculating the checksum
+ // in these cases.
+ //
+ return reprocess || ut == unit_type::module_header
+ ? string ()
+ : move (p.checksum);
}
// Fall through.