]> git.lizzy.rs Git - nothing.git/blob - CMakeLists.txt
Remove cxd tool
[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 find_package(SDL2_mixer REQUIRED)
15
16 include_directories(${SDL2_INCLUDE_DIR})
17 include_directories(${SDL2_MIXER_INCLUDE_DIR})
18
19 set(SOURCE_FILES
20   src/main.c
21   src/player.c
22   src/platforms.c
23   src/rect.c
24   src/point.c
25   src/camera.c
26   src/error.c
27   src/game.c
28   src/lt.c
29   src/lt/lt_slot.c
30   src/level.c
31   src/goals.c
32   src/renderer.c
33   src/triangle.c
34   src/color.c
35   src/rigid_rect.c
36   src/dying_rect.c
37   src/lava.c
38   src/wavy_rect.c
39 )
40
41 set(HEADER_FILES
42   src/player.h
43   src/platforms.h
44   src/rect.h
45   src/point.h
46   src/camera.h
47   src/error.h
48   src/game.h
49   src/lt.h
50   src/lt/lt_slot.h
51   src/level.h
52   src/goals.h
53   src/renderer.h
54   src/triangle.h
55   src/pi.h
56   src/color.h
57   src/rigid_rect.h
58   src/dying_rect.h
59   src/lava.h
60   src/wavy_rect.h
61 )
62
63 add_executable(nothing ${SOURCE_FILES} ${HEADER_FILES})
64 target_link_libraries(nothing ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY})
65
66 if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG"))
67   set(CMAKE_C_FLAGS
68     "${CMAKE_C_FLAGS} \
69      -Wall \
70      -Werror \
71      -Wextra \
72      -Wconversion \
73      -Wunused \
74      -Wunused-function \
75      -Wunused-label \
76      -Wunused-macros \
77      -Wunused-parameter \
78      -Wunused-value \
79      -Wunused-variable \
80      -Wcast-align \
81      -Wcast-qual \
82      -Wmissing-declarations \
83      -Wredundant-decls \
84      -Wmissing-prototypes \
85      -Wnested-externs \
86      -Wpointer-arith \
87      -Wshadow \
88      -Wstrict-prototypes \
89      -Wwrite-strings \
90      -fno-common \
91      -pedantic \
92      -std=c11 \
93      -O3")
94   target_link_libraries(nothing m)
95 endif()
96 if(WIN32)
97   target_link_libraries(nothing Imm32 Version winmm)
98 endif()
99
100 # TODO(#126): C headers are not generated from sounds/*
101 #
102 # Once ./devtools/cxd/ is implementation we need to integrate into the
103 # build and generate header files from sounds/*