From 6613fbc2a3fc96b491b6691145c72c5a9550dc84 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 25 Aug 2022 20:54:40 +0300 Subject: Add target to build configuration id --- mod/build-config.hxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mod/build-config.hxx') diff --git a/mod/build-config.hxx b/mod/build-config.hxx index e8dfe07..4ef01f6 100644 --- a/mod/build-config.hxx +++ b/mod/build-config.hxx @@ -6,6 +6,8 @@ #include +#include + #include #include @@ -44,6 +46,27 @@ namespace brep // path dash_components_to_path (const string&); + + // Build configuration name/target combination that, in particular, + // identifies configurations in the buildtab and thus can be used as a + // set/map key. + // + // Note: contains shallow references to the configuration name and target. + // + struct build_config_id + { + reference_wrapper name; + reference_wrapper target; + + bool + operator< (const build_config_id& x) const + { + if (int r = name.get ().compare (x.name.get ())) + return r < 0; + + return target.get ().compare (x.target.get ()) < 0; + } + }; } #endif // MOD_BUILD_CONFIG -- cgit v1.1