aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-28 12:30:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-28 12:30:32 +0200
commit009e96e5385aef0d34942999e8b67a551ef62957 (patch)
treeda35a8fa1e64ba210826d9b8903015dc0c0c732e /build2
parent936512ff890ef322d9406d024dc9d1a42b039f2b (diff)
Switch to version module
Diffstat (limited to 'build2')
-rw-r--r--build2/.gitignore1
-rw-r--r--build2/buildfile3
-rw-r--r--build2/version-impl37
-rw-r--r--build2/version-impl.in44
4 files changed, 48 insertions, 37 deletions
diff --git a/build2/.gitignore b/build2/.gitignore
index 833a997..a82a338 100644
--- a/build2/.gitignore
+++ b/build2/.gitignore
@@ -2,3 +2,4 @@ b
b-boot
#*-options
#*-options.?xx
+version-impl
diff --git a/build2/buildfile b/build2/buildfile
index 23511b2..8f8d51c 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -107,6 +107,9 @@ exe{b}: {hxx ixx txx cxx}{** -b-options -dummy} \
liba{b} $libs
#\
+hxx{version-impl}: in{version-impl} $src_root/file{manifest}
+hxx{version-impl}: dist = true
+
# Fake utility library (without it code generation does not work).
#
liba{b}: {cxx}{ dummy }
diff --git a/build2/version-impl b/build2/version-impl
deleted file mode 100644
index b6c2a28..0000000
--- a/build2/version-impl
+++ /dev/null
@@ -1,37 +0,0 @@
-// file : build2/version-impl -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#ifndef BUILD2_VERSION // Note: using the version macro itself.
-
-#include <butl/version> // LIBBUTL_VERSION
-
-// Version format is AABBCCDD where
-//
-// AA - major version number
-// BB - minor version number
-// CC - bugfix version number
-// DD - alpha / beta (DD + 50) version number
-//
-// When DD is not 00, 1 is subtracted from AABBCC. For example:
-//
-// Version AABBCCDD
-// 2.0.0 02000000
-// 2.1.0 02010000
-// 2.1.1 02010100
-// 2.2.0-a1 02019901
-// 3.0.0-b2 02999952
-//
-#define BUILD2_VERSION 49901
-#define BUILD2_VERSION_STR "0.5.0-a.1"
-
-// Generally, we expect minor versions to be source code backwards-
-// compatible, thought we might have a minimum version requirement.
-//
-// Note: does not apply during early development.
-//
-#if LIBBUTL_VERSION != 49901
-# error incompatible libbutl version
-#endif
-
-#endif // BUILD2_VERSION
diff --git a/build2/version-impl.in b/build2/version-impl.in
new file mode 100644
index 0000000..a514240
--- /dev/null
+++ b/build2/version-impl.in
@@ -0,0 +1,44 @@
+// file : build2/version-impl.in -*- C++ -*-
+// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+// license : MIT; see accompanying LICENSE file
+
+#ifndef BUILD2_VERSION // Note: using the version macro itself.
+
+// Note: using build2 standard versioning scheme. The numeric version format
+// is AAABBBCCCDDDE where:
+//
+// AAA - major version number
+// BBB - minor version number
+// CCC - bugfix version number
+// DDD - alpha / beta (DDD + 500) version number
+// E - final (0) / snapshot (1)
+//
+// When DDDE is not 0, 1 is subtracted from AAABBBCCC. For example:
+//
+// Version AAABBBCCCDDDE
+//
+// 0.1.0 0000010000000
+// 0.1.2 0000010010000
+// 1.2.3 0010020030000
+// 2.2.0-a.1 0020019990010
+// 3.0.0-b.2 0029999995020
+// 2.2.0-a.1.z 0020019990011
+//
+#define BUILD2_VERSION $build2.version.project_number$ULL
+#define BUILD2_VERSION_STR "$build2.version.project$"
+#define BUILD2_VERSION_ID "$build2.version.project_id$"
+
+#define BUILD2_VERSION_MAJOR $build2.version.major$
+#define BUILD2_VERSION_MINOR $build2.version.minor$
+#define BUILD2_VERSION_PATCH $build2.version.patch$
+
+#define BUILD2_PRE_RELEASE $build2.version.pre_release$
+
+#define BUILD2_SNAPSHOT $build2.version.snapshot_sn$ULL
+#define BUILD2_SNAPSHOT_ID "$build2.version.snapshot_id$"
+
+#include <butl/version>
+
+$libbutl.check(LIBBUTL_VERSION, LIBBUTL_SNAPSHOT)$
+
+#endif // BUILD2_VERSION