]> git.lizzy.rs Git - nothing.git/blob - CMakeLists.txt
(#102) Introduce dying_rect
[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   src/renderer.c
30   src/triangle.c
31   src/color.c
32   src/rigid_rect.c
33   src/dying_rect.c
34 )
35
36 set(HEADER_FILES
37   src/player.h
38   src/platforms.h
39   src/rect.h
40   src/point.h
41   src/camera.h
42   src/error.h
43   src/game.h
44   src/lt.h
45   src/lt/lt_slot.h
46   src/level.h
47   src/goals.h
48   src/renderer.h
49   src/triangle.h
50   src/pi.h
51   src/color.h
52   src/rigid_rect.h
53   src/dying_rect.h
54 )
55
56 add_executable(nothing ${SOURCE_FILES} ${HEADER_FILES})
57 target_link_libraries(nothing ${SDL2_LIBRARY})
58
59 if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG"))
60   set(CMAKE_C_FLAGS
61     "${CMAKE_C_FLAGS} \
62      -Wall \
63      -Werror \
64      -Wextra \
65      -Wconversion \
66      -Wunused \
67      -Wunused-function \
68      -Wunused-label \
69      -Wunused-macros \
70      -Wunused-parameter \
71      -Wunused-value \
72      -Wunused-variable \
73      -Wcast-align \
74      -Wcast-qual \
75      -Wmissing-declarations \
76      -Wredundant-decls \
77      -Wmissing-prototypes \
78      -Wnested-externs \
79      -Wpointer-arith \
80      -Wshadow \
81      -Wstrict-prototypes \
82      -Wwrite-strings \
83      -fno-common \
84      -pedantic \
85      -std=c11 \
86      -O3")
87   target_link_libraries(nothing m)
88 endif()
89 if(WIN32)
90   target_link_libraries(nothing Imm32 Version winmm)
91 endif()