]> git.lizzy.rs Git - nothing.git/blob - CMakeLists.txt
Rename is_game_over -> game_over_check (#72)
[nothing.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.2)
2 project(nothing)
3
4 if(WIN32)
5   # Conan integration
6   include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
7   conan_basic_setup()
8 endif()
9
10 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
11
12 find_package(SDL2 REQUIRED)
13
14 include_directories(${SDL2_INCLUDE_DIR})
15
16 set(SOURCE_FILES
17   src/main.c
18   src/player.c
19   src/platforms.c
20   src/rect.c
21   src/point.c
22   src/camera.c
23   src/error.c
24   src/game.c
25   src/lt.c
26   src/lt/lt_slot.c
27   src/level.c
28   src/goals.c
29 )
30
31 set(HEADER_FILES
32   src/player.h
33   src/platforms.h
34   src/rect.h
35   src/point.h
36   src/camera.h
37   src/error.h
38   src/game.h
39   src/lt.h
40   src/lt/lt_slot.h
41   src/level.h
42   src/goals.h
43 )
44
45 add_executable(nothing ${SOURCE_FILES} ${HEADER_FILES})
46 target_link_libraries(nothing ${SDL2_LIBRARY})
47
48 if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG"))
49   set(CMAKE_C_FLAGS
50     "${CMAKE_C_FLAGS} \
51      -Wall \
52      -Werror \
53      -Wextra \
54      -Wconversion \
55      -Wunused \
56      -Wunused-function \
57      -Wunused-label \
58      -Wunused-macros \
59      -Wunused-parameter \
60      -Wunused-value \
61      -Wunused-variable \
62      -Wcast-align \
63      -Wcast-qual \
64      -Wmissing-declarations \
65      -Wredundant-decls \
66      -Wmissing-prototypes \
67      -Wnested-externs \
68      -Wpointer-arith \
69      -Wshadow \
70      -Wstrict-prototypes \
71      -Wwrite-strings \
72      -fno-common \
73      -pedantic \
74      -std=c11 \
75      -O3")
76   target_link_libraries(nothing m)
77 endif()
78 if(WIN32)
79   target_link_libraries(nothing Imm32 Version winmm)
80 endif()