simon-git: puzzles (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Mon Mar 29 19:05:40 BST 2021
TL;DR:
72b28b5 Fix bit rot in the 'unfinished' subdir.
cc7f550 Migrate to a CMake-based build system.
3ff4d64 Remove winiss.pl.
ff3e762 Remove old Windows CE cruft.
Repository: https://git.tartarus.org/simon/puzzles.git
On the web: https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2021-03-29 19:05:40
commit 72b28b5e71b05e7775d14b1e3e2e00b82af4d87a
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=72b28b5e71b05e7775d14b1e3e2e00b82af4d87a;hp=84cb4c6701e027090ff3fd955ce08065e20121b2
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Mar 29 18:13:38 2021 +0100
Fix bit rot in the 'unfinished' subdir.
Several of the source files here won't quite compile any more, because
of minor things like const-correctness and the UI_UPDATE change. Now
they should all build again (without prejudice to how useful they are
once they have built).
The biggest change was to remove the fatal() implementation from the
standalone path.c, because my new plan is that basically everything
that's not linked against a true puzzle frontend will be linked
against nullfe.c, which provides that function anyway.
unfinished/numgame.c | 4 ++--
unfinished/path.c | 23 +++--------------------
unfinished/slide.c | 4 ++--
3 files changed, 7 insertions(+), 24 deletions(-)
commit cc7f5503dc8f4ddf468e080a73028c83d1196e83
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=cc7f5503dc8f4ddf468e080a73028c83d1196e83;hp=72b28b5e71b05e7775d14b1e3e2e00b82af4d87a
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Mar 29 18:23:11 2021 +0100
Migrate to a CMake-based build system.
This completely removes the old system of mkfiles.pl + Recipe + .R
files that I used to manage the various per-platform makefiles and
other build scripts in this code base. In its place is a
CMakeLists.txt setup, which is still able to compile for Linux,
Windows, MacOS, NestedVM and Emscripten.
The main reason for doing this is because mkfiles.pl was a horrible
pile of unmaintainable cruft. It was hard to keep up to date (e.g.
didn't reliably support the latest Visual Studio project files); it
was so specific to me that nobody else could maintain it (or was even
interested in trying, and who can blame them?), and it wasn't even
easy to _use_ if you weren't me. And it didn't even produce very good
makefiles.
In fact I've been wanting to hurl mkfiles.pl in the bin for years, but
was blocked by CMake not quite being able to support my clang-cl based
system for cross-compiling for Windows on Linux. But CMake 3.20 was
released this month and fixes the last bug in that area (it had to do
with preprocessing of .rc files), so now I'm unblocked!
CMake is not perfect, but it's better at mkfiles.pl's job than
mkfiles.pl was, and it has the great advantage that lots of other
people already know about it.
Other advantages of the CMake system:
- Easier to build with. At least for the big three platforms, it's
possible to write down a list of build commands that's actually the
same everywhere ("cmake ." followed by "cmake --build ."). There's
endless scope for making your end-user cmake commands more fancy
than that, for various advantages, but very few people _have_ to.
- Less effort required to add a new puzzle. You just add a puzzle()
statement to the top-level CMakeLists.txt, instead of needing to
remember eight separate fiddly things to put in the .R file. (Look
at the reduction in CHECKLST.txt!)
- The 'unfinished' subdirectory is now _built_ unconditionally, even
if the things in it don't go into the 'make install' target. So
they won't bit-rot in future.
- Unix build: unified the old icons makefile with the main build, so
that each puzzle builds without an icon, runs to build its icon,
then relinks with it.
- Windows build: far easier to switch back and forth between debug
and release than with the old makefiles.
- MacOS build: CMake has its own .dmg generator, which is surely
better thought out than my ten-line bodge.
- net reduction in the number of lines of code in the code base. In
fact, that's still true _even_ if you don't count the deletion of
mkfiles.pl itself - that script didn't even have the virtue of
allowing everything else to be done exceptionally concisely.
.gitignore | 1 -
Buildscr | 180 ++--
CHECKLST.txt | 30 +-
CMakeLists.txt | 264 +++++
README | 46 +-
Recipe | 171 ---
blackbox.R | 19 -
bridges.R | 21 -
cmake/glob-symlinks.py | 65 ++
cmake/nestedvm-toolchain.cmake | 10 +
cmake/platforms/emscripten.cmake | 47 +
cmake/platforms/nestedvm.cmake | 60 ++
cmake/platforms/osx.cmake | 58 ++
cmake/platforms/unix.cmake | 68 ++
cmake/platforms/windows.cmake | 40 +
cmake/setup.cmake | 133 +++
cmake/testbuild.c | 23 +
cmake/windows-dummy-toolchain.cmake | 14 +
configure.ac | 85 --
cube.R | 19 -
devel.but | 14 +-
dominosa.R | 24 -
emccx.json | 33 -
fifteen.R | 22 -
filling.R | 24 -
flip.R | 21 -
flood.R | 19 -
galaxies.R | 28 -
guess.R | 19 -
icons/Makefile | 162 ---
icons/cicon.pl | 3 +-
icons/crop.sh | 16 +-
icons/icon.pl | 5 +-
icons/icons.cmake | 237 +++++
icons/screenshot.sh | 25 -
icons/square.pl | 6 +-
inertia.R | 19 -
keen.R | 25 -
lightup.R | 24 -
list.c | 21 +
loopy.R | 31 -
magnets.R | 24 -
makedist.sh | 47 -
map.R | 24 -
mines.R | 24 -
mkauto.sh | 2 -
mkfiles.pl | 1953 -----------------------------------
net.R | 23 -
netslide.R | 21 -
noicon.rc | 11 -
nullgame.R | 12 -
osx.m | 4 +-
osx-info.plist => osx/Info.plist | 0
osx.icns => osx/Puzzles.icns | Bin
palisade.R | 21 -
pattern.R | 25 -
pearl.R | 23 -
pegs.R | 21 -
puzzles.rc2 => puzzles.rc | 13 +-
range.R | 21 -
rect.R | 19 -
samegame.R | 19 -
signpost.R | 23 -
singles.R | 23 -
sixteen.R | 19 -
slant.R | 24 -
solo.R | 24 -
tents.R | 24 -
towers.R | 25 -
tracks.R | 24 -
twiddle.R | 19 -
undead.R | 18 -
unequal.R | 25 -
unfinished/CMakeLists.txt | 31 +
unfinished/README | 15 +-
unfinished/group.R | 25 -
unfinished/separate.R | 21 -
unfinished/slide.R | 24 -
unfinished/sokoban.R | 19 -
unruly.R | 21 -
untangle.R | 21 -
webpage.pl | 6 +-
82 files changed, 1202 insertions(+), 3668 deletions(-)
commit 3ff4d64060b7cf5675bc8a49a1746b7d7c3b26b8
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=3ff4d64060b7cf5675bc8a49a1746b7d7c3b26b8;hp=cc7f5503dc8f4ddf468e080a73028c83d1196e83
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Mar 29 18:48:07 2021 +0100
Remove winiss.pl.
I noticed this while I was overhauling the build system. We haven't
used an Inno Setup based installer for years, so the script that
constructed Inno Setup's input file is well and truly obsolete and
should have been deleted long since.
winiss.pl | 79 ---------------------------------------------------------------
1 file changed, 79 deletions(-)
commit ff3e762fd0078836243011ca91210f32ea7d1cbd
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=ff3e762fd0078836243011ca91210f32ea7d1cbd;hp=3ff4d64060b7cf5675bc8a49a1746b7d7c3b26b8
Author: Simon Tatham <anakin at pobox.com>
Date: Mon Mar 29 18:28:32 2021 +0100
Remove old Windows CE cruft.
The WinCE version of these puzzles hasn't been built for years, and
the last vestiges of its build system vanished with the migration to
CMake. So this seems like a good moment to lose the rest of it.
So the supporting Perl script wceinf.pl is deleted, and so is all the
unused code under '#ifdef _WIN32_WCE' in windows.c. (I removed that
using unifdef, which did a more reliable job than I would have done by
hand!)
wceinf.pl | 65 --------
windows.c | 531 +-------------------------------------------------------------
2 files changed, 1 insertion(+), 595 deletions(-)
More information about the tartarus-commits
mailing list