feat: embed version string and git commit hash (#1008)

This commit is contained in:
Wagner Bruna
2025-12-09 22:38:54 +08:00
committed by GitHub
parent a908436729
commit e72aea796e
4 changed files with 73 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#include "stable-diffusion.h"
#ifndef SDCPP_BUILD_COMMIT
#define SDCPP_BUILD_COMMIT unknown
#endif
#ifndef SDCPP_BUILD_VERSION
#define SDCPP_BUILD_VERSION unknown
#endif
#define STRINGIZE2(x) #x
#define STRINGIZE(x) STRINGIZE2(x)
const char* sd_commit(void) {
return STRINGIZE(SDCPP_BUILD_COMMIT);
}
const char* sd_version(void) {
return STRINGIZE(SDCPP_BUILD_VERSION);
}