aboutsummaryrefslogtreecommitdiff
path: root/build/utility
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-12-07 12:16:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-12-07 12:16:29 +0200
commit8b55e8151bd69e4ef11a67aff57618193f559618 (patch)
treee420000affbf3c6d7016470649d2cc711b883c7a /build/utility
parentc092793e74d0778b0aff653860f274c8cc31c374 (diff)
Add support for specifying minimum required build2 version
The syntax is: using build@0.1.0-a1 The idea is that we will later also use it for modules and 'build' is a special, the "build system itself" module. Also fix a problem with peeking and lexer mode switching.
Diffstat (limited to 'build/utility')
-rw-r--r--build/utility10
1 files changed, 9 insertions, 1 deletions
diff --git a/build/utility b/build/utility
index 404b33a..6769f95 100644
--- a/build/utility
+++ b/build/utility
@@ -7,7 +7,7 @@
#include <tuple>
#include <string>
-#include <utility> // move()
+#include <utility> // move(), make_pair()
#include <cassert> // assert()
#include <exception>
#include <unordered_set>
@@ -17,6 +17,7 @@
namespace build
{
using std::move;
+ using std::make_pair;
// Empty string and path.
//
@@ -24,6 +25,13 @@ namespace build
extern const path empty_path;
extern const dir_path empty_dir_path;
+ // Parse version string in the X.Y.Z[-{a|b}N] to a version integer in the
+ // AABBCCDD form as describe in <build/version>. Throw invalid_argument
+ // if the passed string is not a valid version.
+ //
+ unsigned int
+ to_version (const string&);
+
// Call a function if there is an exception.
//