-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (40 loc) · 1.17 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
cmake_minimum_required(VERSION 3.10)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(cnake
DESCRIPTION "snake game written in C and C++"
HOMEPAGE_URL "https://github.com/RaphGL/Cnake"
LANGUAGES C;CXX
)
# --- Original C implementation ---
add_executable(cnake
cnake_src/colors.c
cnake_src/colors.h
cnake_src/game.c
cnake_src/game.h
cnake_src/leaderboard.c
cnake_src/leaderboard.h
cnake_src/main.c
cnake_src/optionmenu.c
cnake_src/optionmenu.h
cnake_src/startscreen.c
cnake_src/startscreen.h
cnake_src/vector.c
cnake_src/vector.h
)
target_compile_features(cnake PUBLIC c_std_11)
target_link_libraries(cnake ncursesw m)
target_compile_options(cnake PUBLIC -Wall -Wextra -pedantic-errors)
# --- Improved C++ implementation ---
add_executable(cnakepp
cnakepp_src/consts.hpp
cnakepp_src/food.cpp
cnakepp_src/food.hpp
cnakepp_src/game_manager.cpp
cnakepp_src/game_manager.hpp
cnakepp_src/main.cpp
cnakepp_src/snake.cpp
cnakepp_src/snake.hpp
)
target_link_libraries(cnakepp ncursesw)
target_compile_features(cnakepp PRIVATE cxx_std_20)
target_compile_options(cnakepp PUBLIC -Wall -Wextra -pedantic-errors)