mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Implement dynamic git version information in build metadata
- Added CMake git detection to capture branch and commit hash - Modified frozen_stubs.c to use CMake-provided git information - Build info now shows actual git metadata instead of "default" - Updated STUBS.md to reflect improvement Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -34,22 +34,32 @@ struct _inittab _PyImport_Inittab[] = {
|
||||
};
|
||||
|
||||
/* Build info stubs */
|
||||
|
||||
/* Use CMake-generated git information if available */
|
||||
#ifndef GIT_COMMIT_HASH
|
||||
#define GIT_COMMIT_HASH "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef GIT_BRANCH
|
||||
#define GIT_BRANCH "default"
|
||||
#endif
|
||||
|
||||
const char *
|
||||
Py_GetBuildInfo(void)
|
||||
{
|
||||
return "Typthon 3.14.0 (default, " __DATE__ " " __TIME__ ")";
|
||||
return "Typthon 3.14.0 (" GIT_BRANCH ":" GIT_COMMIT_HASH ", " __DATE__ " " __TIME__ ")";
|
||||
}
|
||||
|
||||
const char *
|
||||
_Py_gitidentifier(void)
|
||||
{
|
||||
return "default";
|
||||
return GIT_BRANCH;
|
||||
}
|
||||
|
||||
const char *
|
||||
_Py_gitversion(void)
|
||||
{
|
||||
return "Typthon 3.14.0";
|
||||
return "Typthon 3.14.0:" GIT_COMMIT_HASH;
|
||||
}
|
||||
|
||||
/* DL open flags stub */
|
||||
|
||||
Reference in New Issue
Block a user