aboutsummaryrefslogtreecommitdiff
path: root/mod/build-config.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-08-25 20:54:40 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-08-29 17:18:19 +0300
commit6613fbc2a3fc96b491b6691145c72c5a9550dc84 (patch)
treebb1116efb5b475608458038240a4ba80e32b99af /mod/build-config.hxx
parent340cf0935a199240f6daaab8a347e22172f4d15b (diff)
Add target to build configuration id
Diffstat (limited to 'mod/build-config.hxx')
-rw-r--r--mod/build-config.hxx23
1 files changed, 23 insertions, 0 deletions
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 <map>
+#include <libbutl/target-triplet.hxx>
+
#include <libbpkg/manifest.hxx>
#include <libbbot/build-config.hxx>
@@ -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<const string> name;
+ reference_wrapper<const butl::target_triplet> 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