]> git.lizzy.rs Git - nothing.git/blob - CMakeLists.txt
Introduce game entity and outline its interface (#22)
[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 )
26
27 set(HEADER_FILES
28   src/player.h
29   src/platforms.h
30   src/rect.h
31   src/point.h
32   src/camera.h
33   src/error.h
34   src/game.h
35 )
36
37 add_executable(nothing ${SOURCE_FILES} ${HEADER_FILES})
38 target_link_libraries(nothing ${SDL2_LIBRARY})
39
40 if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG"))
41   set(CMAKE_C_FLAGS
42     "${CMAKE_C_FLAGS} \
43      -Wall \
44      -Werror \
45      -Wextra \
46      -Wconversion \
47      -Wunused \
48      -Wunused-function \
49      -Wunused-label \
50      -Wunused-macros \
51      -Wunused-parameter \
52      -Wunused-value \
53      -Wunused-variable \
54      -Wcast-align \
55      -Wcast-qual \
56      -Wmissing-declarations \
57      -Wredundant-decls \
58      -Wmissing-prototypes \
59      -Wnested-externs \
60      -Wpointer-arith \
61      -Wshadow \
62      -Wstrict-prototypes \
63      -Wwrite-strings \
64      -fno-common \
65      -pedantic \
66      -std=c11 \
67      -O3")
68   target_link_libraries(nothing m)
69 endif()
70 if(WIN32)
71   target_link_libraries(nothing Imm32 Version winmm)
72 endif()