From b50980ad70684530d55b7adf20de6047ebf53ba2 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Thu, 3 Oct 2024 09:28:01 -0500 Subject: Use a configure file for versioning including git revision. --- source/libfud.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source') diff --git a/source/libfud.cpp b/source/libfud.cpp index e1dad1d..252eae0 100644 --- a/source/libfud.cpp +++ b/source/libfud.cpp @@ -17,10 +17,26 @@ #include "libfud.hpp" +#include "fud_assert.hpp" +#include "git_version.hpp" + #include namespace fud { +FUD fud() +{ + FUD fudInfo{}; + fudInfo.major = FudVersionMajor; + fudInfo.minor = FudVersionMinor; + fudInfo.patch = FudVersionPatch; + static_assert(sizeof(GitHash) >= sizeof(fudInfo.revision)); + auto copyResult = copyMem(fudInfo.revision.data(), fudInfo.revision.size(), GitHash, fudInfo.revision.size() - 1); + fudAssert(copyResult == FudStatus::Success); + fudInfo.revision[fudInfo.revision.size() - 1] = '\0'; + return fudInfo; +} + Result getEnv(const char* name) { using RetType = Result; -- cgit v1.2.3