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