aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-04-20 11:19:28 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-04-20 11:26:05 +0200
commit0353b231d51ab7ea5ead98ac838e7c2ba1b0df89 (patch)
treec5b0794512587a1062de97153df6f0b236f928d3 /libbuild2/cc/module.cxx
parent834152a6e3f3e8459b53e49370bfdd82685a700d (diff)
Track changes to environment in cc rules
Diffstat (limited to 'libbuild2/cc/module.cxx')
-rw-r--r--libbuild2/cc/module.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbuild2/cc/module.cxx b/libbuild2/cc/module.cxx
index 5bb3f60..7ef8cd5 100644
--- a/libbuild2/cc/module.cxx
+++ b/libbuild2/cc/module.cxx
@@ -202,8 +202,22 @@ namespace build2
}
}
+ // Hash the environment (used for change detection).
+ //
+ // Note that for simplicity we use the combined checksum for both
+ // compilation and linking (which may compile, think LTO).
+ //
+ {
+ sha256 cs;
+ hash_environment (cs, xi.compiler_environment);
+ hash_environment (cs, xi.platform_environment);
+ env_checksum = cs.string ();
+ }
+
// Assign values to variables that describe the compiler.
//
+ // @@ TODO: env_checksum.
+ //
rs.assign (x_path) = process_path_ex (xi.path, x_name, xi.checksum);
const strings& xm (cast<strings> (rs.assign (x_mode) = move (mode)));