From 3cf3b73ffc6881d5428a735736a347f6e143b366 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Feb 2016 10:57:40 +0200 Subject: Implement auxiliary dependency database (.d files), use in cxx.compile This is part of the "High Fidelity Build" work. --- build2/utility | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'build2/utility') 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 + void + append_options (cstrings&, T&, const char* variable); + + template + void + hash_options (sha256&, T&, const char* variable); + + // As above but from the strings value directly. + // + class value; + template struct lookup; + template struct vector_value; + using const_strings_value = vector_value; + + void + append_options (cstrings&, const lookup&); + + void + hash_options (sha256&, const lookup&); + + 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 + bool + find_option (const char* option, T&, const char* variable); + + bool + find_option (const char* option, const lookup&); + // 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 + #endif // BUILD2_UTILITY -- cgit v1.1