From 484b4eb7ec20d01230f22e159c33b7225af34ab9 Mon Sep 17 00:00:00 2001 From: steven-na Date: Sat, 1 Aug 2026 23:31:27 -0700 Subject: Automatic build versioning --- src/version.c | 19 +++++++++++++++++++ src/version.h | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/version.c create mode 100644 src/version.h (limited to 'src') diff --git a/src/version.c b/src/version.c new file mode 100644 index 0000000..df10b08 --- /dev/null +++ b/src/version.c @@ -0,0 +1,19 @@ +#include "version.h" +#include "version_gen.h" + +char const *steez_version_string(void) { + return STEEZ_VERSION_STRING; +} + +steez_build_info_t steez_build_info(void) { + return (steez_build_info_t){ + .major = STEEZ_VERSION_MAJOR, + .minor = STEEZ_VERSION_MINOR, + .patch = STEEZ_VERSION_PATCH, + .string = STEEZ_VERSION_STRING, + .git_commit = STEEZ_GIT_COMMIT, + .build_date = STEEZ_BUILD_DATE, + .build_time = STEEZ_BUILD_TIME, + .build_type = STEEZ_BUILD_TYPE, + }; +} diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..6042d27 --- /dev/null +++ b/src/version.h @@ -0,0 +1,15 @@ +#pragma once + +#include "common.h" + +typedef struct { + i32 major, minor, patch; + char const *string; + char const *git_commit; + char const *build_date; + char const *build_time; + char const *build_type; +} steez_build_info_t; + +char const *steez_version_string(void); +steez_build_info_t steez_build_info(void); -- cgit v1.2.3