fix: windows: flavor in build.h was always UNKNOWN

This commit is contained in:
Stéphane Lesimple
2020-08-31 22:11:20 +02:00
parent 0598fad827
commit 22b2aba490

View File

@@ -1,17 +1,21 @@
#!/usr/bin/env bash #!/usr/bin/env bash
build=$(grep BUILDNUM $1 2>/dev/null | cut -d\ -f3) build=$(grep BUILDNUM $1 2>/dev/null | cut -d\ -f3)
build=$((build+1)) build=$((build+1))
flavor=$(grep FLAVOR $1 2>/dev/null | cut -d\ -f3) cat >$1 <<EOF
if [ -z "$flavor" ]; then #ifdef CLI
flavor=UNKNOWN #define FLAVOR CLI
fi #else
echo "#define FLAVOR $flavor" >$1 #define FLAVOR GUI
#endif
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
EOF
echo "#define BUILDNUM $build" >>$1 echo "#define BUILDNUM $build" >>$1
if git describe >/dev/null 2>/dev/null; then if git describe >/dev/null 2>/dev/null; then
gitver=$(git describe --tags --dirty) gitver=$(git describe --tags --dirty)
echo "#define BUILD \"$gitver-$flavor-speed47.build$build\"" >>$1 echo "#define BUILD \"$gitver-\" TOSTRING(FLAVOR) \"-speed47.build$build\"" >>$1
else else
echo "#define BUILD \"$flavor-speed47.build$build\"" >>$1 echo "#define BUILD TOSTRING(FLAVOR) \"-speed47.build$build\"" >>$1
fi fi
date=$(date +"%d.%m.%y (%A, %H:%M)") date=$(date +"%d.%m.%y (%A, %H:%M)")
echo "#define BDATE \"$date\"" >>$1 echo "#define BDATE \"$date\"" >>$1