dev: automatic version.h generation

also added compiler information as a feature
This commit is contained in:
2025-07-04 15:19:25 +02:00
parent 3ec1eec56f
commit 19a1355b06
5 changed files with 66 additions and 17 deletions

View File

@@ -20,6 +20,16 @@
#define UNULLABLE
#endif
#if defined(__clang__)
#define COMPILER_VERSION __VERSION__
#elif defined(__GNUC__)
#define xstr(s) str(s)
#define str(s) #s
#define COMPILER_VERSION \
"GCC " xstr(__GNUC__) "." xstr(__GNUC_MINOR__) "." xstr(__GNUC_PATCHLEVEL__)
#endif
#define LEN(X) (sizeof(X) / sizeof((X)[0]))
#endif

View File

@@ -1,9 +0,0 @@
#ifndef LIDM_VERSION
#define LIDM_VERSION "v1.1.1"
#endif
#ifndef LIDM_GIT_DESCRIPTION
#define LIDM_GIT_DESCRIPTION "?"
#endif
#ifndef LIDM_BUILD_DATE
#define LIDM_BUILD_DATE "?"
#endif