ref: bcb78f5d186592d66127f7f07e6c85d059f7ccb9
parent: de7d1facf3609165bb8b8bb96e19022ef4f46dfc
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Fri Apr 9 08:08:11 EDT 2021
Define `__RGBDS_VERSION__` as the output of `rgbasm --version` (sans "rgbasm") Fixes #824
--- a/src/asm/rgbasm.5
+++ b/src/asm/rgbasm.5
@@ -1272,6 +1272,7 @@
.It Dv __RGBDS_MINOR__ Ta Ic EQU Ta Minor version number of RGBDS
.It Dv __RGBDS_PATCH__ Ta Ic EQU Ta Patch version number of RGBDS
.It Dv __RGBDS_RC__ Ta Ic EQU Ta Release candidate ID of RGBDS, not defined for final releases
+.It Dv __RGBDS_VERSION__ Ta Ic EQUS Ta Version of RGBDS, as printed by Ql rgbasm --version
.El
.Pp
The current time values will be taken from the
--- a/src/asm/symbol.c
+++ b/src/asm/symbol.c
@@ -774,6 +774,7 @@
addString("__UTC_HOUR__", removeLeadingZeros(savedHOUR));
addString("__UTC_MINUTE__", removeLeadingZeros(savedMINUTE));
addString("__UTC_SECOND__", removeLeadingZeros(savedSECOND));
+ addString("__RGBDS_VERSION__", get_package_version_string());
#undef addString
labelScope = NULL;
--- a/test/asm/test.sh
+++ b/test/asm/test.sh
@@ -38,6 +38,7 @@
# Add the version constants test, outputting the closest tag to the HEAD
if git describe --tags --abbrev=0 > version.out; then
+ $RGBASM --version >> version.out
cat > version.asm <<EOF
IF !DEF(__RGBDS_RC__)
PRINTLN "v{d:__RGBDS_MAJOR__}.{d:__RGBDS_MINOR__}.{d:__RGBDS_PATCH__}"
@@ -44,6 +45,7 @@
ELSE
PRINTLN "v{d:__RGBDS_MAJOR__}.{d:__RGBDS_MINOR__}.{d:__RGBDS_PATCH__}-rc{d:__RGBDS_RC__}"
ENDC
+ PRINTLN "rgbasm {__RGBDS_VERSION__}"
EOF
else
echo "${bold}${orange}Warning: cannot run version test!${rescolors}${resbold}"