aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--odb/buildfile7
-rw-r--r--odb/version-build2.hxx.in40
-rw-r--r--odb/version.hxx5
4 files changed, 56 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 209706c..65207af 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,3 +27,7 @@
# Generated .gitignore files.
#
.gitignore
+
+# Temporarily here because of auto-generated odb/.gitignore.
+#
+odb/version-build2.hxx
diff --git a/odb/buildfile b/odb/buildfile
index e9958c1..562b5b5 100644
--- a/odb/buildfile
+++ b/odb/buildfile
@@ -56,6 +56,7 @@ lib{odb}: \
{hxx ixx cxx}{ vector-impl } \
{hxx txx }{ vector-traits } \
{hxx }{ version } \
+ {hxx }{ version-build2 } \
{hxx }{ view-image } \
{hxx txx }{ view-result } \
{hxx }{ wrapper-traits } \
@@ -92,6 +93,9 @@ details/shared-ptr/{hxx }{ counter-type } \
details/shared-ptr/{hxx }{ exception } \
details/win32/{hxx }{ windows }
+hxx{version-build2}: in{version-build2} $src_root/file{manifest}
+hxx{version-build2}: dist = true
+
# For pre-releases use the complete version to make sure they cannot be used
# in place of another pre-release or the final version.
#
@@ -118,6 +122,9 @@ if ($cxx.target.class != "windows")
# We want these to be picked up even when LIBODB_BUILD2 is not defined.
#
+hxx{version}@./: install = false
+hxx{version-build2}: install = $install.include/version.hxx
+
details/build2/:
{
if ($cxx.id == "msvc")
diff --git a/odb/version-build2.hxx.in b/odb/version-build2.hxx.in
new file mode 100644
index 0000000..95d80d8
--- /dev/null
+++ b/odb/version-build2.hxx.in
@@ -0,0 +1,40 @@
+// file : odb/version-build2.hxx.in
+// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef LIBODB_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 LIBODB_VERSION $libodb.version.project_number$ULL
+#define LIBODB_VERSION_STR "$libodb.version.project$"
+#define LIBODB_VERSION_ID "$libodb.version.project_id$"
+
+#define LIBODB_VERSION_MAJOR $libodb.version.major$
+#define LIBODB_VERSION_MINOR $libodb.version.minor$
+#define LIBODB_VERSION_PATCH $libodb.version.patch$
+
+#define LIBODB_PRE_RELEASE $libodb.version.pre_release$
+
+#define LIBODB_SNAPSHOT $libodb.version.snapshot_sn$ULL
+#define LIBODB_SNAPSHOT_ID "$libodb.version.snapshot_id$"
+
+#endif // LIBODB_VERSION
diff --git a/odb/version.hxx b/odb/version.hxx
index 954a15f..0242ac4 100644
--- a/odb/version.hxx
+++ b/odb/version.hxx
@@ -2,6 +2,10 @@
// copyright : Copyright (c) 2005-2017 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
+#ifdef LIBODB_BUILD2
+# include <odb/version-build2.hxx>
+#else
+
#ifndef ODB_VERSION_HXX
#define ODB_VERSION_HXX
@@ -37,3 +41,4 @@
#include <odb/post.hxx>
#endif // ODB_VERSION_HXX
+#endif // LIBODB_BUILD2