From 02c759ee303c740d287054f3042911aac1bf046a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 25 Aug 2022 12:25:16 +0300 Subject: Make configuration name/target unique --- libbbot/build-config.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libbbot/build-config.cxx') 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"); -- cgit v1.1