summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/CMakeLists.txt
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2024-07-22 21:43:25 -0400
committerFranklin Wei <franklin@rockbox.org>2024-07-22 21:44:08 -0400
commit09aa8de52cb962f1ceebfb1fd44f2c54a924fc5c (patch)
tree182bd4efb2dc8ca4fcb369d8cccab0c0f290d054 /apps/plugins/puzzles/src/CMakeLists.txt
parentc72030f98c953a82ed6f5c7132ad000c3d5f4a16 (diff)
downloadrockbox-09aa8de52cb962f1ceebfb1fd44f2c54a924fc5c.tar.gz
rockbox-09aa8de52cb962f1ceebfb1fd44f2c54a924fc5c.zip
puzzles: resync with upstream
This brings the puzzles source in sync with Simon's branch, commit fd304c5 (from March 2024), with some added Rockbox-specific compatibility changes: https://www.franklinwei.com/git/puzzles/commit/?h=rockbox-devel&id=516830d9d76bdfe64fe5ccf2a9b59c33f5c7c078 There are quite a lot of backend changes, including a new "Mosaic" puzzle. In addition, some new frontend changes were necessary: - New "Preferences" menu to access the user preferences system. - Enabled spacebar input for several games. Change-Id: I94c7df674089c92f32d5f07025f6a1059068af1e
Diffstat (limited to 'apps/plugins/puzzles/src/CMakeLists.txt')
-rw-r--r--apps/plugins/puzzles/src/CMakeLists.txt287
1 files changed, 287 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/CMakeLists.txt b/apps/plugins/puzzles/src/CMakeLists.txt
new file mode 100644
index 0000000000..4153efc246
--- /dev/null
+++ b/apps/plugins/puzzles/src/CMakeLists.txt
@@ -0,0 +1,287 @@
1cmake_minimum_required(VERSION 3.5)
2
3project(puzzles
4 LANGUAGES C)
5
6include(cmake/setup.cmake)
7
8add_library(core_obj OBJECT
9 combi.c divvy.c drawing.c dsf.c findloop.c grid.c latin.c
10 laydomino.c loopgen.c malloc.c matching.c midend.c misc.c penrose.c
11 penrose-legacy.c ps.c random.c sort.c tdq.c tree234.c version.c
12 ${platform_common_sources})
13add_library(core $<TARGET_OBJECTS:core_obj>)
14add_library(common $<TARGET_OBJECTS:core_obj> hat.c spectre.c)
15
16include_directories(${CMAKE_CURRENT_SOURCE_DIR})
17
18puzzle(blackbox
19 DISPLAYNAME "Black Box"
20 DESCRIPTION "Ball-finding puzzle"
21 OBJECTIVE "Find the hidden balls in the box by bouncing laser beams \
22off them.")
23
24puzzle(bridges
25 DISPLAYNAME "Bridges"
26 DESCRIPTION "Bridge-placing puzzle"
27 OBJECTIVE "Connect all the islands with a network of bridges.")
28
29puzzle(cube
30 DISPLAYNAME "Cube"
31 DESCRIPTION "Rolling cube puzzle"
32 OBJECTIVE "Pick up all the blue squares by rolling the cube over them.")
33
34puzzle(dominosa
35 DISPLAYNAME "Dominosa"
36 DESCRIPTION "Domino tiling puzzle"
37 OBJECTIVE "Tile the rectangle with a full set of dominoes.")
38solver(dominosa)
39
40puzzle(fifteen
41 DISPLAYNAME "Fifteen"
42 DESCRIPTION "Sliding block puzzle"
43 OBJECTIVE "Slide the tiles around to arrange them into order.")
44solver(fifteen)
45
46puzzle(filling
47 DISPLAYNAME "Filling"
48 DESCRIPTION "Polyomino puzzle"
49 OBJECTIVE "Mark every square with the area of its containing region.")
50solver(filling)
51
52puzzle(flip
53 DISPLAYNAME "Flip"
54 DESCRIPTION "Tile inversion puzzle"
55 OBJECTIVE "Flip groups of squares to light them all up at once.")
56
57puzzle(flood
58 DISPLAYNAME "Flood"
59 DESCRIPTION "Flood-filling puzzle"
60 OBJECTIVE "Turn the grid the same colour in as few flood fills as possible.")
61
62puzzle(galaxies
63 DISPLAYNAME "Galaxies"
64 DESCRIPTION "Symmetric polyomino puzzle"
65 OBJECTIVE "Divide the grid into rotationally symmetric regions each \
66centred on a dot.")
67solver(galaxies)
68cliprogram(galaxiespicture galaxies.c
69 COMPILE_DEFINITIONS STANDALONE_PICTURE_GENERATOR)
70guiprogram(galaxieseditor galaxies.c
71 COMPILE_DEFINITIONS EDITOR)
72
73puzzle(guess
74 DISPLAYNAME "Guess"
75 DESCRIPTION "Combination-guessing puzzle"
76 OBJECTIVE "Guess the hidden combination of colours.")
77
78puzzle(inertia
79 DISPLAYNAME "Inertia"
80 DESCRIPTION "Gem-collecting puzzle"
81 OBJECTIVE "Collect all the gems without running into any of the mines.")
82
83puzzle(keen
84 DISPLAYNAME "Keen"
85 DESCRIPTION "Arithmetic Latin square puzzle"
86 OBJECTIVE "Complete the latin square in accordance with the \
87arithmetic clues.")
88solver(keen latin.c)
89
90puzzle(lightup
91 DISPLAYNAME "Light Up"
92 DESCRIPTION "Light-bulb placing puzzle"
93 OBJECTIVE "Place bulbs to light up all the squares.")
94solver(lightup)
95
96puzzle(loopy
97 DISPLAYNAME "Loopy"
98 DESCRIPTION "Loop-drawing puzzle"
99 OBJECTIVE "Draw a single closed loop, given clues about number of \
100adjacent edges.")
101solver(loopy)
102
103puzzle(magnets
104 DISPLAYNAME "Magnets"
105 DESCRIPTION "Magnet-placing puzzle"
106 OBJECTIVE "Place magnets to satisfy the clues and avoid like poles \
107touching.")
108solver(magnets)
109
110puzzle(map
111 DISPLAYNAME "Map"
112 DESCRIPTION "Map-colouring puzzle"
113 OBJECTIVE "Colour the map so that adjacent regions are never the \
114same colour.")
115solver(map)
116
117puzzle(mines
118 DISPLAYNAME "Mines"
119 DESCRIPTION "Mine-finding puzzle"
120 OBJECTIVE "Find all the mines without treading on any of them.")
121cliprogram(mineobfusc mines.c COMPILE_DEFINITIONS STANDALONE_OBFUSCATOR)
122
123puzzle(mosaic
124 DISPLAYNAME "Mosaic"
125 DESCRIPTION "Grid-filling puzzle"
126 OBJECTIVE "Fill in the grid given clues about number of \
127nearby black squares.")
128
129puzzle(net
130 # The Windows Net shouldn't be called 'net.exe', since Windows
131 # already has a reasonably important utility program by that name!
132 WINDOWS_EXE_NAME netgame
133
134 DISPLAYNAME "Net"
135 DESCRIPTION "Network jigsaw puzzle"
136 OBJECTIVE "Rotate each tile to reassemble the network.")
137
138puzzle(netslide
139 DISPLAYNAME "Netslide"
140 DESCRIPTION "Toroidal sliding network puzzle"
141 OBJECTIVE "Slide a row at a time to reassemble the network.")
142
143puzzle(nullgame)
144
145puzzle(palisade
146 DISPLAYNAME "Palisade"
147 DESCRIPTION "Grid-division puzzle"
148 OBJECTIVE "Divide the grid into equal-sized areas in accordance with\
149 the clues.")
150
151puzzle(pattern
152 DISPLAYNAME "Pattern"
153 DESCRIPTION "Pattern puzzle"
154 OBJECTIVE "Fill in the pattern in the grid, given only the lengths \
155of runs of black squares.")
156solver(pattern)
157cliprogram(patternpicture pattern.c
158 COMPILE_DEFINITIONS STANDALONE_PICTURE_GENERATOR)
159
160puzzle(pearl
161 DISPLAYNAME "Pearl"
162 DESCRIPTION "Loop-drawing puzzle"
163 OBJECTIVE "Draw a single closed loop, given clues about corner and \
164straight squares.")
165solver(pearl)
166cliprogram(pearlbench pearl.c COMPILE_DEFINITIONS STANDALONE_SOLVER)
167
168puzzle(pegs
169 DISPLAYNAME "Pegs"
170 DESCRIPTION "Peg solitaire puzzle"
171 OBJECTIVE "Jump pegs over each other to remove all but one.")
172
173puzzle(range
174 DISPLAYNAME "Range"
175 DESCRIPTION "Visible-distance puzzle"
176 OBJECTIVE "Place black squares to limit the visible distance from \
177each numbered cell.")
178
179puzzle(rect
180 DISPLAYNAME "Rectangles"
181 DESCRIPTION "Rectangles puzzle"
182 OBJECTIVE "Divide the grid into rectangles with areas equal to the \
183numbers.")
184
185puzzle(samegame
186 DISPLAYNAME "Same Game"
187 DESCRIPTION "Block-clearing puzzle"
188 OBJECTIVE "Clear the grid by removing touching groups of the same \
189colour squares.")
190
191puzzle(signpost
192 DISPLAYNAME "Signpost"
193 DESCRIPTION "Square-connecting puzzle"
194 OBJECTIVE "Connect the squares into a path following the arrows.")
195solver(signpost)
196
197puzzle(singles
198 DISPLAYNAME "Singles"
199 DESCRIPTION "Number-removing puzzle"
200 OBJECTIVE "Black out the right set of duplicate numbers.")
201solver(singles)
202
203puzzle(sixteen
204 DISPLAYNAME "Sixteen"
205 DESCRIPTION "Toroidal sliding block puzzle"
206 OBJECTIVE "Slide a row at a time to arrange the tiles into order.")
207
208puzzle(slant
209 DISPLAYNAME "Slant"
210 DESCRIPTION "Maze-drawing puzzle"
211 OBJECTIVE "Draw a maze of slanting lines that matches the clues.")
212solver(slant)
213
214puzzle(solo
215 DISPLAYNAME "Solo"
216 DESCRIPTION "Number placement puzzle"
217 OBJECTIVE "Fill in the grid so that each row, column and square \
218block contains one of every digit.")
219solver(solo)
220
221puzzle(tents
222 DISPLAYNAME "Tents"
223 DESCRIPTION "Tent-placing puzzle"
224 OBJECTIVE "Place a tent next to each tree.")
225solver(tents)
226
227puzzle(towers
228 DISPLAYNAME "Towers"
229 DESCRIPTION "Tower-placing Latin square puzzle"
230 OBJECTIVE "Complete the latin square of towers in accordance with \
231the clues.")
232solver(towers latin.c)
233
234puzzle(tracks
235 DISPLAYNAME "Tracks"
236 DESCRIPTION "Path-finding railway track puzzle"
237 OBJECTIVE "Fill in the railway track according to the clues.")
238solver(tracks)
239
240puzzle(twiddle
241 DISPLAYNAME "Twiddle"
242 DESCRIPTION "Rotational sliding block puzzle"
243 OBJECTIVE "Rotate the tiles around themselves to arrange them into order.")
244
245puzzle(undead
246 DISPLAYNAME "Undead"
247 DESCRIPTION "Monster-placing puzzle"
248 OBJECTIVE "Place ghosts, vampires and zombies so that the right \
249numbers of them can be seen in mirrors.")
250
251puzzle(unequal
252 DISPLAYNAME "Unequal"
253 DESCRIPTION "Latin square puzzle"
254 OBJECTIVE "Complete the latin square in accordance with the > signs.")
255solver(unequal latin.c)
256
257puzzle(unruly
258 DISPLAYNAME "Unruly"
259 DESCRIPTION "Black and white grid puzzle"
260 OBJECTIVE "Fill in the black and white grid to avoid runs of three.")
261solver(unruly)
262
263puzzle(untangle
264 DISPLAYNAME "Untangle"
265 DESCRIPTION "Planar graph layout puzzle"
266 OBJECTIVE "Reposition the points so that the lines do not cross.")
267
268add_subdirectory(unfinished)
269add_subdirectory(auxiliary)
270
271if(build_cli_programs)
272 write_generated_games_header()
273 include(CheckFunctionExists)
274 check_function_exists(HF_ITER HAVE_HF_ITER)
275 set(WITH_LIBFUZZER OFF
276 CACHE BOOL "Build fuzzpuzz using Clang's libFuzzer")
277 cliprogram(fuzzpuzz fuzzpuzz.c list.c ${puzzle_sources}
278 COMPILE_DEFINITIONS COMBINED $<$<BOOL:${WITH_LIBFUZZER}>:OMIT_MAIN>
279 $<$<BOOL:${HAVE_HF_ITER}>:HAVE_HF_ITER>)
280 target_include_directories(fuzzpuzz PRIVATE ${generated_include_dir})
281 if(WITH_LIBFUZZER)
282 target_compile_options(fuzzpuzz PRIVATE -fsanitize=fuzzer)
283 set_target_properties(fuzzpuzz PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
284 endif()
285endif()
286
287build_extras()