aboutsummaryrefslogtreecommitdiff
path: root/build2/version/init.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/version/init.cxx')
-rw-r--r--build2/version/init.cxx34
1 files changed, 19 insertions, 15 deletions
diff --git a/build2/version/init.cxx b/build2/version/init.cxx
index 9884d58..2c80cec 100644
--- a/build2/version/init.cxx
+++ b/build2/version/init.cxx
@@ -120,27 +120,13 @@ namespace build2
string d (v, b, e - b);
trim (d);
- p = d.find_first_of (" \t=<>[(");
+ p = d.find_first_of (" \t=<>[(~^");
string n (d, 0, p);
string c (p != string::npos ? string (d, p) : string ());
trim (n);
trim (c);
- // If this is a dependency on the build system itself, check
- // it (so there is no need for explicit using build@X.Y.Z).
- //
- if (n == "build2" && !c.empty ())
- try
- {
- check_build_version (standard_version_constraint (c), l);
- }
- catch (const invalid_argument& e)
- {
- fail (l) << "invalid version constraint for dependency "
- << d << ": " << e;
- }
-
try
{
ds.emplace (project_name (move (n)).variable (), move (c));
@@ -192,6 +178,24 @@ namespace build2
committed = false;
}
+ // If there is a dependency on the build system itself, check it (so
+ // there is no need for explicit using build@X.Y.Z).
+ //
+ {
+ auto i (ds.find ("build2"));
+
+ if (i != ds.end () && !i->second.empty ())
+ try
+ {
+ check_build_version (standard_version_constraint (i->second, v), l);
+ }
+ catch (const invalid_argument& e)
+ {
+ fail (l) << "invalid version constraint for dependency build2 "
+ << i->second << ": " << e;
+ }
+ }
+
// Set all the version.* variables.
//
auto& vp (var_pool.rw (rs));