forked from OpenAssetIO/OpenAssetIO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.hpp.in
70 lines (61 loc) · 2.38 KB
/
version.hpp.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// SPDX-License-Identifier: Apache-2.0
// Copyright 2024 The Foundry Visionmongers Ltd
#pragma once
#include <cstddef>
#include <string_view>
#include <openassetio/export.h>
// clang-format off
#define OPENASSETIO_VERSION_MAJOR @OpenAssetIO_VERSION_MAJOR@
#define OPENASSETIO_VERSION_MINOR @OpenAssetIO_VERSION_MINOR@
#define OPENASSETIO_VERSION_PATCH @OpenAssetIO_VERSION_PATCH@
// clang-format on
// For the time being, beta versions must be manually updated prior to
// the release
#define OPENASSETIO_BETA_VERSION_MAJOR 2
#define OPENASSETIO_BETA_VERSION_MINOR 2
#define OPENASSETIO_STRINGIFY(x) #x
#define OPENASSETIO_MACRO_TO_STRING(x) OPENASSETIO_STRINGIFY(x)
// clang-format off
#define OPENASSETIO_VERSION_STRING \
"v@OpenAssetIO_VERSION@-beta." OPENASSETIO_MACRO_TO_STRING(OPENASSETIO_BETA_VERSION_MAJOR)\
"." OPENASSETIO_MACRO_TO_STRING(OPENASSETIO_BETA_VERSION_MINOR)
// clang-format on
namespace openassetio {
inline namespace OPENASSETIO_CORE_ABI_VERSION {
/**
* The major version of the OpenAssetIO library.
*/
constexpr std::size_t majorVersion() { return OPENASSETIO_VERSION_MAJOR; }
/**
* The minor version of the OpenAssetIO library.
*/
constexpr std::size_t minorVersion() { return OPENASSETIO_VERSION_MINOR; }
/**
* The patch version of the OpenAssetIO library.
*/
constexpr std::size_t patchVersion() { return OPENASSETIO_VERSION_PATCH; }
/**
* The beta major version of the OpenAssetIO library.
*
* Whilst OpenAssetIO is in beta, its main versioning remains at 1.0.0,
* and the beta versions are incremented.
* When OpenAssetIO leaves beta, this value will return 0.
*/
constexpr std::size_t betaMajorVersion() { return OPENASSETIO_BETA_VERSION_MAJOR; }
/**
* The beta minor version of the OpenAssetIO library.
*
* Whilst OpenAssetIO is in beta, its main versioning remains at 1.0.0,
* and the beta versions are incremented.
* When OpenAssetIO leaves beta, this value will return 0.
*/
constexpr std::size_t betaMinorVersion() { return OPENASSETIO_BETA_VERSION_MINOR; }
/**
* A string containing the OpenAssetIO version string.
*
* The format is {MAJOR}.{MINOR}.{PATCH}-beta{BETAMAJOR}.{BETAMINOR}.
* When OpenAssetIO leaves beta, the beta section will be removed.
*/
constexpr std::string_view versionString() { return OPENASSETIO_VERSION_STRING; }
} // namespace OPENASSETIO_CORE_ABI_VERSION
} // namespace openassetio