diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-08-25 12:25:16 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-08-26 16:25:59 +0300 |
commit | 02c759ee303c740d287054f3042911aac1bf046a (patch) | |
tree | 0762af5bc660dcba142a2480901fc040a5594010 /libbbot | |
parent | b41e4bf1a9266c180c4208ca5fc864e918b842b2 (diff) |
Make configuration name/target unique
Diffstat (limited to 'libbbot')
-rw-r--r-- | libbbot/build-config.cxx | 16 | ||||
-rw-r--r-- | libbbot/build-config.hxx | 3 |
2 files changed, 11 insertions, 8 deletions
diff --git a/libbbot/build-config.cxx b/libbbot/build-config.cxx index c46cffd..01ce57e 100644 --- a/libbbot/build-config.cxx +++ b/libbbot/build-config.cxx @@ -75,14 +75,6 @@ namespace bbot config.name = move (tl[i].value); - // Make sure the name is unique. - // - for (const auto& c: r) - { - if (c.name == config.name) - bad_line ("duplicate configuration name"); - } - if (++i == n) bad_line ("no target found"); @@ -116,6 +108,14 @@ namespace bbot bad_line (e.what ()); } + // Make sure the name/target combination is unique. + // + for (const auto& c: r) + { + if (c.name == config.name && c.target == config.target) + bad_line ("duplicate configuration name/target"); + } + if (++i == n) bad_line ("no classes found"); diff --git a/libbbot/build-config.hxx b/libbbot/build-config.hxx index e4bb5cb..473e5d8 100644 --- a/libbbot/build-config.hxx +++ b/libbbot/build-config.hxx @@ -55,6 +55,9 @@ namespace bbot // // <machine-pattern> <config> <target>[/<environment>] <classes> [<config-arg>]* [<warning-regex>]* // + // Note that each <config>/<target> pair is expected to be unique in the + // buildtab. + // using butl::tab_parsing; LIBBBOT_EXPORT build_configs |