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