Small snake game in C
| 1 | cmake_minimum_required(VERSION 3.20) |
| 2 | |
| 3 | project(snake C) |
| 4 | |
| 5 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
| 6 | |
| 7 | include(FetchContent) |
| 8 | |
| 9 | FetchContent_Declare( |
| 10 | jag_parse |
| 11 | GIT_REPOSITORY https://codeberg.org/Jaglekon/jag_parse.git |
| 12 | GIT_TAG v1.1.1 |
| 13 | ) |
| 14 | |
| 15 | FetchContent_Declare( |
| 16 | jag_write |
| 17 | GIT_REPOSITORY https://codeberg.org/Jaglekon/jag_write.git |
| 18 | GIT_TAG v1.0.1 |
| 19 | ) |
| 20 | |
| 21 | FetchContent_MakeAvailable(jag_parse jag_write) |
| 22 | |
| 23 | add_executable(snake |
| 24 | source/main.c |
| 25 | source/logic.c |
| 26 | source/draw.c |
| 27 | source/parameters.c |
| 28 | source/settings_file/settings_file.c |
| 29 | source/animation/animation.c |
| 30 | source/read_input/read_input.c |
| 31 | ) |
| 32 | |
| 33 | target_link_libraries(snake PRIVATE |
| 34 | jag_parse |
| 35 | jag_write |
| 36 | ) |
| 37 | |
| 38 | target_compile_options(snake PRIVATE |
| 39 | $<$<CONFIG:Debug>:-Wall -Wextra -Wpedantic> |
| 40 | ) |