File tree 5 files changed +23
-1
lines changed
5 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,9 @@ if(NOT DEFINED GIT_BRANCH)
33
33
)
34
34
endif ()
35
35
36
+ file (STRINGS "VERSION" ASYNC_POSTGRES_VERSION)
36
37
project (gmsv_async_postgres
37
- VERSION 1.0.0
38
+ VERSION ${ASYNC_POSTGRES_VERSION}
38
39
LANGUAGES C CXX
39
40
HOMEPAGE_URL "https://github.com/Pika-Software/gmsv_async_postgres"
40
41
)
Original file line number Diff line number Diff line change
1
+ 1.0.0
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ target_include_directories(async_postgres PRIVATE
23
23
24
24
set_gmod_suffix_prefix(async_postgres)
25
25
26
+ # Set version
27
+ add_definitions (-DASYNC_POSTGRES_VERSION="${CMAKE_PROJECT_VERSION} " -DASYNC_POSTGRES_BRANCH="${GIT_BRANCH} " )
28
+
26
29
# Autoinstall
27
30
set (AUTOINSTALL "" CACHE PATH "Autoinstall path" )
28
31
if (IS_DIRECTORY ${AUTOINSTALL} )
Original file line number Diff line number Diff line change 15
15
16
16
#include " safe_pg.hpp"
17
17
18
+ #define LUA_API_VERSION 1
19
+
18
20
namespace GLua = GarrysMod::Lua;
19
21
20
22
#define lua_interface () \
Original file line number Diff line number Diff line change @@ -301,6 +301,21 @@ void make_global_table(GLua::ILuaInterface* lua) {
301
301
302
302
async_postgres::register_enums (lua);
303
303
304
+ lua->PushNumber (LUA_API_VERSION);
305
+ lua->SetField (-2 , " LUA_API_VERSION" );
306
+
307
+ lua->PushNumber (PQlibVersion ());
308
+ lua->SetField (-2 , " PQ_VERSION" );
309
+
310
+ lua->PushString (ASYNC_POSTGRES_VERSION);
311
+ lua->SetField (-2 , " VERSION" );
312
+
313
+ lua->PushString (ASYNC_POSTGRES_BRANCH);
314
+ lua->SetField (-2 , " BRANCH" );
315
+
316
+ lua->PushString (" https://github.com/Pika-Software/gmsv_async_postgres" );
317
+ lua->SetField (-2 , " URL" );
318
+
304
319
lua->SetField (GLua::INDEX_GLOBAL, " async_postgres" );
305
320
}
306
321
You can’t perform that action at this time.
0 commit comments