aboutsummaryrefslogtreecommitdiff
path: root/libbbot/build-config.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbbot/build-config.cxx')
-rw-r--r--libbbot/build-config.cxx25
1 files changed, 23 insertions, 2 deletions
diff --git a/libbbot/build-config.cxx b/libbbot/build-config.cxx
index 1e8b8dc..65a64ab 100644
--- a/libbbot/build-config.cxx
+++ b/libbbot/build-config.cxx
@@ -68,7 +68,8 @@ namespace bbot
//
bool placeholder (config.machine_pattern == "-");
- // Configuration name, target and classes fields are the required ones.
+ // Configuration name, target[/environment] and classes fields are the
+ // required ones.
//
if (i == n)
bad_line ("no configuration name found");
@@ -89,7 +90,27 @@ namespace bbot
if (!placeholder)
try
{
- config.target = target_triplet (tl[i].value);
+ const string& v (tl[i].value);
+
+ // Extract the environment name, if present.
+ //
+ size_t p (v.find ('/'));
+
+ if (p != string::npos)
+ {
+ string env (v, p + 1);
+
+ if (env.empty ())
+ bad_line ("empty environment");
+
+ config.environment = move (env);
+ }
+
+ // Parse the target triplet.
+ //
+ config.target = target_triplet (p != string::npos
+ ? string (v, 0, p)
+ : v);
}
catch (const invalid_argument& e)
{