feat(version): added support for building version information

This commit is contained in:
2025-08-06 16:20:43 -05:00
parent 57e8c4a499
commit 97af579397
4 changed files with 36 additions and 2 deletions

17
genver.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Script to generate version information file
# Current git tag
TAG="$(git describe --always --dirty --tags)"
# Output filename
OUTFILE='src/version.c'
sed -e "s/<HASH>/$TAG/g" <<EOF > "$OUTFILE"
/* Build version information. This file generated by genver.sh */
const char GIT_HASH[] = "<HASH>";
const char CC_VERSION[] = __VERSION__;
const char BUILD_DATE[] = __DATE__;
EOF