Skip to content

Commit f58454a

Browse files
committed
Add versioning and 1.0.0 as version
1 parent d0915f1 commit f58454a

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
# limitations under the License.
1414

1515
cmake_minimum_required(VERSION 3.4)
16-
project(mgclient VERSION 0.1)
16+
17+
project(mgclient VERSION 1.0.0)
18+
# Minor version increase can also mean ABI incompatibility with previous
19+
# versions. IMPORTANT: Take care of the SO version manually.
20+
set(mgclient_SOVERSION 1)
21+
add_definitions(-DMGCLIENT_VERSION="${mgclient_VERSION}")
22+
1723
# Building tests is disabled by default to simplify the default build config.
1824
option(BUILD_TESTING "" OFF)
1925
# Integration tests are disabled by default, since the memgraph instance is

include/mgclient.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ extern "C" {
129129

130130
#include <stdint.h>
131131

132+
/// Client software version.
133+
///
134+
/// \return Client version in the major.minor.patch format.
135+
MGCLIENT_EXPORT const char *mg_client_version();
136+
132137
/// An enum listing all the types as specified by Bolt protocol.
133138
enum mg_value_type {
134139
MG_VALUE_TYPE_NULL,

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ target_link_libraries(mgclient-static PRIVATE ${OPENSSL_LIBRARIES})
4040
add_library(mgclient-shared SHARED ${mgclient_src_files})
4141
set_target_properties(mgclient-shared PROPERTIES
4242
OUTPUT_NAME mgclient
43+
SOVERSION ${mgclient_SOVERSION}
4344
C_VISIBILITY_PRESET hidden)
4445
target_include_directories(mgclient-shared
4546
PUBLIC

src/mgclient.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include "mgmessage.h"
3434
#include "mgsession.h"
3535

36+
const char *mg_client_version() { return MGCLIENT_VERSION; }
37+
3638
typedef struct mg_session_params {
3739
const char *address;
3840
const char *host;

0 commit comments

Comments
 (0)