summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-10-29 22:39:57 -0500
committerDanny Holman <dholman@gymli.org>2024-10-29 22:41:22 -0500
commita97d152c8495ccf4272c733b63747a78b0371afa (patch)
treec84f4b0182519e79e093a28645625cac6a15fad5
parent6709e300385c610f14b848961c2c5afdbc9aadc0 (diff)
build: use lib name in version macros
Use the library name in version define macros. This should prevent collisions when using the engine alongside other libraries, as the VERSION keyword is likely very common. In addition, create three new macros for the major, minor and patch numbers separately. This allows the engine to use only the part it needs, when it needs it. Signed-off-by: Danny Holman <dholman@gymli.org>
-rw-r--r--CMakeLists.txt5
-rw-r--r--core/init.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4ad9c0..91f8a98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,7 +67,10 @@ endif()
list(APPEND LINK_LIBS ${GLFW_LIBRARIES})
-add_compile_definitions(VERSION="${PROJECT_VERSION}")
+add_compile_definitions(RUNE_VER="${PROJECT_VERSION}")
+add_compile_definitions(RUNE_VER_MAJOR="${PROJECT_VERSION_MAJOR}")
+add_compile_definitions(RUNE_VER_MINOR="${PROJECT_VERSION_MINOR}")
+add_compile_definitions(RUNE_VER_PATCH="${PROJECT_VERSION_PATCH}")
add_compile_definitions(RAPI_EXPORT)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
diff --git a/core/init.c b/core/init.c
index 96fee70..1a600ef 100644
--- a/core/init.c
+++ b/core/init.c
@@ -6,7 +6,8 @@
int rune_init(int argc, char* argv[]) {
enable_log_color();
- log_output(LOG_INFO, "Started Rune Engine version %s", VERSION);
+ log_output(LOG_INFO, "Started Rune Engine version %s", RUNE_VER);
+ _parse_args(argc, argv);
rune_init_thread_api();
return 0;
}