Windows: add a VERSIONINFO resource to the puzzle binaries.

This includes the textual version number in its existing
form (yyyymmdd followed by an abbreviated git hash). The four-part
binary version is set to 1 followed by year, month and day; if I ever
want to change that, I can increment the initial 1.

FileDescription is taken from the existing DESCRIPTION string provided
to each puzzle() statement in CMakeLists.txt.

This means that puzzles.rc now always defines at least one resource,
so we can remove the workaround for MinGW's windres not being able to
cope with an empty .rc file, which added a dummy resource in the
absence of an icon.
This commit is contained in:
Simon Tatham
2023-11-19 11:54:48 +00:00
parent 595338fa43
commit 08365fb260
5 changed files with 75 additions and 9 deletions

View File

@ -17,6 +17,7 @@ in puzzles do perl -e 'print "\n\\versionid Simon Tatham'\''s Portable Puzzle Co
# Write out a version.h that contains the real version number.
in puzzles do echo '/* Generated by automated build script */' > version.h
in puzzles do echo '$#define VER "Version $(Version)"' >> version.h
in puzzles do perl -e '$$ARGV[0] =~ m{(....)(..)(..)} or die; print "$#define VERSIONINFO_BINARY_VERSION 1,$$1,$$2,$$3\n"' $(!builddate) >> version.h
# And do the same substitution in the OS X metadata. (This is a bit
# icky in principle because it presumes that my version numbers don't