aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-04-20 08:55:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-04-20 08:55:59 +0200
commitdca10cb2cc9ae928edf945274b5860d5bbc9dea3 (patch)
tree1fdcadeac9599c4bd5db53fab700dfc8fdef6008 /libbuild2/context.hxx
parent9034f7c51ef6437ce9d4547ba5bde217b4740fb2 (diff)
Add import cache
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r--libbuild2/context.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx
index 9083556..6eb85f7 100644
--- a/libbuild2/context.hxx
+++ b/libbuild2/context.hxx
@@ -540,6 +540,26 @@ namespace build2
build2::meta_operation_table meta_operation_table;
build2::operation_table operation_table;
+ // Import cache (see import_load()).
+ //
+ struct import_key
+ {
+ dir_path out_root; // Imported project's out root.
+ name target; // Imported target (unqualified).
+ uint64_t metadata; // Metadata version (0 if none).
+
+ friend bool
+ operator< (const import_key& x, const import_key& y)
+ {
+ int r;
+ return ((r = x.out_root.compare (y.out_root)) != 0 ? r < 0 :
+ (r = x.target.compare (y.target)) != 0 ? r < 0 :
+ x.metadata < y.metadata);
+ }
+ };
+
+ map<import_key, pair<names, const scope&>> import_cache;
+
// The old/new src_root remapping for subprojects.
//
dir_path old_src_root;