aboutsummaryrefslogtreecommitdiff
path: root/build2/utility
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-02-29 10:57:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-02-29 10:57:40 +0200
commit3cf3b73ffc6881d5428a735736a347f6e143b366 (patch)
tree3559fa9d2d44cc11e07987752027f7c2a9e3e23e /build2/utility
parent2a4f52c46f2081aaeb2664e8026d3d067142e3d5 (diff)
Implement auxiliary dependency database (.d files), use in cxx.compile
This is part of the "High Fidelity Build" work.
Diffstat (limited to 'build2/utility')
-rw-r--r--build2/utility42
1 files changed, 42 insertions, 0 deletions
diff --git a/build2/utility b/build2/utility
index a61fb08..187834e 100644
--- a/build2/utility
+++ b/build2/utility
@@ -39,6 +39,46 @@ namespace build2
extern const path empty_path;
extern const dir_path empty_dir_path;
+ // Append all the values from a variable to the C-string list. T is either
+ // target or scope. The variable is expected to be of type strings.
+ //
+ template <typename T>
+ void
+ append_options (cstrings&, T&, const char* variable);
+
+ template <typename T>
+ void
+ hash_options (sha256&, T&, const char* variable);
+
+ // As above but from the strings value directly.
+ //
+ class value;
+ template <typename> struct lookup;
+ template <typename, typename> struct vector_value;
+ using const_strings_value = vector_value<string, const names>;
+
+ void
+ append_options (cstrings&, const lookup<const value>&);
+
+ void
+ hash_options (sha256&, const lookup<const value>&);
+
+ void
+ append_options (cstrings&, const const_strings_value&);
+
+ void
+ hash_options (sha256&, const const_strings_value&);
+
+ // Check if a specified option is present in the variable value.
+ // T is either target or scope.
+ //
+ template <typename T>
+ bool
+ find_option (const char* option, T&, const char* variable);
+
+ bool
+ find_option (const char* option, const lookup<const value>&);
+
// Parse version string in the X.Y.Z[-{a|b}N] to a version integer in the
// AABBCCDD form, where:
//
@@ -122,4 +162,6 @@ namespace build2
};
}
+#include <build2/utility.ixx>
+
#endif // BUILD2_UTILITY