diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-06-24 12:01:19 +0200 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-07-01 18:13:55 +0300 |
commit | 977d07a3ae47ef204665d1eda2d642e5064724f3 (patch) | |
tree | 525a3d6421f61ce789b690191d3c30fc09be3517 /build2/utility.ixx | |
parent | 7161b24963dd9da4d218f92c736b77c35c328a2d (diff) |
Split build system into library and driver
Diffstat (limited to 'build2/utility.ixx')
-rw-r--r-- | build2/utility.ixx | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/build2/utility.ixx b/build2/utility.ixx deleted file mode 100644 index 1b1fe79..0000000 --- a/build2/utility.ixx +++ /dev/null @@ -1,155 +0,0 @@ -// file : build2/utility.ixx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -namespace build2 -{ - inline void - hash_path (sha256& cs, const path& p, const dir_path& prefix) - { - // Note: for efficiency we don't use path::leaf() and "skip" the prefix - // without copying. - // - const char* s (p.string ().c_str ()); - - if (!prefix.empty () && p.sub (prefix)) - { - s += prefix.size (); // Does not include trailing slash except for root. - if (path::traits_type::is_separator (*s)) - ++s; - } - - cs.append (s); - } - - template <typename T> - inline void - append_options (cstrings& args, T& s, const variable& var, const char* e) - { - append_options (args, s[var], e); - } - - template <typename T> - inline void - append_options (strings& args, T& s, const variable& var, const char* e) - { - append_options (args, s[var], e); - } - - template <typename T> - inline void - hash_options (sha256& csum, T& s, const variable& var) - { - hash_options (csum, s[var]); - } - - template <typename T> - inline void - append_options (cstrings& args, T& s, const char* var, const char* e) - { - append_options (args, s[var], e); - } - - template <typename T> - inline void - append_options (strings& args, T& s, const char* var, const char* e) - { - append_options (args, s[var], e); - } - - template <typename T> - inline void - hash_options (sha256& csum, T& s, const char* var) - { - hash_options (csum, s[var]); - } - - inline void - append_options (cstrings& args, const strings& sv, const char* e) - { - if (size_t n = sv.size ()) - append_options (args, sv, n, e); - } - - inline void - append_options (strings& args, const strings& sv, const char* e) - { - if (size_t n = sv.size ()) - append_options (args, sv, n, e); - } - - inline void - hash_options (sha256& csum, const strings& sv) - { - if (size_t n = sv.size ()) - hash_options (csum, sv, n); - } - - template <typename T> - inline bool - find_option (const char* o, T& s, const variable& var, bool ic) - { - return find_option (o, s[var], ic); - } - - template <typename T> - inline bool - find_option (const char* o, T& s, const char* var, bool ic) - { - return find_option (o, s[var], ic); - } - - template <typename T> - inline bool - find_options (initializer_list<const char*> os, - T& s, - const variable& var, - bool ic) - { - return find_options (os, s[var], ic); - } - - template <typename T> - inline bool - find_options (initializer_list<const char*> os, - T& s, - const char* var, - bool ic) - { - return find_options (os, s[var], ic); - } - - template <typename T> - inline const string* - find_option_prefix (const char* p, T& s, const variable& var, bool ic) - { - return find_option_prefix (p, s[var], ic); - } - - template <typename T> - inline const string* - find_option_prefix (const char* p, T& s, const char* var, bool ic) - { - return find_option_prefix (p, s[var], ic); - } - - template <typename T> - inline const string* - find_option_prefixes (initializer_list<const char*> ps, - T& s, - const variable& var, - bool ic) - { - return find_option_prefixes (ps, s[var], ic); - } - - template <typename T> - inline const string* - find_option_prefixes (initializer_list<const char*> ps, - T& s, - const char* var, - bool ic) - { - return find_option_prefixes (ps, s[var], ic); - } -} |