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