2017-12-01 21:26:06 -08:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2017-11-30 17:52:59 -08:00
|
|
|
project(nothing)
|
|
|
|
|
2017-12-09 21:02:44 -08:00
|
|
|
if(WIN32)
|
|
|
|
# Conan integration
|
|
|
|
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
|
|
|
conan_basic_setup()
|
|
|
|
endif()
|
|
|
|
|
2017-12-02 06:30:26 -08:00
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
2017-12-01 22:21:15 -08:00
|
|
|
|
2017-11-30 17:52:59 -08:00
|
|
|
find_package(SDL2 REQUIRED)
|
2018-03-01 13:03:56 -08:00
|
|
|
find_package(SDL2_mixer REQUIRED)
|
|
|
|
|
2018-04-29 05:45:50 -07:00
|
|
|
include_directories(src/)
|
2017-11-30 17:52:59 -08:00
|
|
|
include_directories(${SDL2_INCLUDE_DIR})
|
2018-03-01 13:03:56 -08:00
|
|
|
include_directories(${SDL2_MIXER_INCLUDE_DIR})
|
2017-11-30 17:52:59 -08:00
|
|
|
|
|
|
|
set(SOURCE_FILES
|
2018-04-29 06:59:56 -07:00
|
|
|
src/color.c
|
2017-12-16 09:41:14 -08:00
|
|
|
src/game.c
|
2018-05-02 21:43:54 -07:00
|
|
|
src/game/camera.c
|
2018-07-29 11:10:18 -07:00
|
|
|
src/game/debug_tree.c
|
2018-08-04 09:27:15 -07:00
|
|
|
src/game/edit_field.c
|
2018-04-29 05:48:11 -07:00
|
|
|
src/game/level.c
|
2018-04-29 12:15:15 -07:00
|
|
|
src/game/level/background.c
|
2018-05-21 09:40:13 -07:00
|
|
|
src/game/level/boxes.c
|
2018-04-29 05:59:16 -07:00
|
|
|
src/game/level/goals.c
|
2018-07-22 12:09:40 -07:00
|
|
|
src/game/level/labels.c
|
2018-04-29 06:01:01 -07:00
|
|
|
src/game/level/lava.c
|
2018-04-29 06:03:56 -07:00
|
|
|
src/game/level/lava/wavy_rect.c
|
2018-07-02 12:34:29 -07:00
|
|
|
src/game/level/physical_world.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/game/level/platforms.c
|
|
|
|
src/game/level/player.c
|
|
|
|
src/game/level/player/dying_rect.c
|
|
|
|
src/game/level/player/rigid_rect.c
|
2018-05-21 09:40:13 -07:00
|
|
|
src/game/level/solid.c
|
2018-05-03 05:53:21 -07:00
|
|
|
src/game/sound_samples.c
|
2018-07-14 11:22:38 -07:00
|
|
|
src/game/sprite_font.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/main.c
|
2018-04-29 06:14:14 -07:00
|
|
|
src/math/mat3x3.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/point.c
|
2018-04-29 06:12:50 -07:00
|
|
|
src/math/rand.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/rect.c
|
|
|
|
src/math/triangle.c
|
2018-08-18 12:15:09 -07:00
|
|
|
src/script/expr.c
|
2018-09-01 10:26:01 -07:00
|
|
|
src/script/interpreter.c
|
2018-08-19 11:26:21 -07:00
|
|
|
src/script/parser.c
|
2018-08-26 13:36:23 -07:00
|
|
|
src/script/tokenizer.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/sdl/renderer.c
|
|
|
|
src/system/error.c
|
|
|
|
src/system/lt.c
|
2018-06-19 09:06:40 -07:00
|
|
|
src/system/lt/lt_adapters.c
|
2018-07-01 09:29:07 -07:00
|
|
|
src/system/lt/lt_slot.c
|
2017-11-30 17:52:59 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
set(HEADER_FILES
|
2018-04-29 06:59:56 -07:00
|
|
|
src/color.h
|
2017-12-16 09:41:14 -08:00
|
|
|
src/game.h
|
2018-05-02 21:43:54 -07:00
|
|
|
src/game/camera.h
|
2018-07-29 12:05:04 -07:00
|
|
|
src/game/debug_node.h
|
2018-07-29 11:10:18 -07:00
|
|
|
src/game/debug_tree.h
|
2018-08-04 09:27:15 -07:00
|
|
|
src/game/edit_field.h
|
2018-04-29 05:48:11 -07:00
|
|
|
src/game/level.h
|
2018-04-29 12:15:15 -07:00
|
|
|
src/game/level/background.h
|
2018-07-01 09:29:07 -07:00
|
|
|
src/game/level/boxes.h
|
2018-04-29 05:59:16 -07:00
|
|
|
src/game/level/goals.h
|
2018-07-22 12:09:40 -07:00
|
|
|
src/game/level/labels.h
|
2018-04-29 06:01:01 -07:00
|
|
|
src/game/level/lava.h
|
2018-04-29 06:03:56 -07:00
|
|
|
src/game/level/lava/wavy_rect.h
|
2018-07-02 12:34:29 -07:00
|
|
|
src/game/level/physical_world.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/game/level/platforms.h
|
|
|
|
src/game/level/player.h
|
|
|
|
src/game/level/player/dying_rect.h
|
|
|
|
src/game/level/player/rigid_rect.h
|
2018-05-21 09:40:13 -07:00
|
|
|
src/game/level/solid.h
|
2018-05-03 05:53:21 -07:00
|
|
|
src/game/sound_samples.h
|
2018-07-14 11:22:38 -07:00
|
|
|
src/game/sprite_font.h
|
2018-04-29 06:14:14 -07:00
|
|
|
src/math/mat3x3.h
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/pi.h
|
|
|
|
src/math/point.h
|
2018-04-29 06:12:50 -07:00
|
|
|
src/math/rand.h
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/rect.h
|
|
|
|
src/math/triangle.h
|
2018-09-02 10:48:45 -07:00
|
|
|
src/script/builtins.c
|
|
|
|
src/script/builtins.h
|
2018-08-18 12:15:09 -07:00
|
|
|
src/script/expr.h
|
2018-09-01 10:26:01 -07:00
|
|
|
src/script/interpreter.h
|
2018-08-19 11:26:21 -07:00
|
|
|
src/script/parser.h
|
2018-08-26 13:36:23 -07:00
|
|
|
src/script/tokenizer.h
|
2018-04-29 06:59:56 -07:00
|
|
|
src/sdl/renderer.h
|
|
|
|
src/system/error.h
|
|
|
|
src/system/lt.h
|
2018-06-19 09:06:40 -07:00
|
|
|
src/system/lt/lt_adapters.h
|
2018-07-01 09:29:07 -07:00
|
|
|
src/system/lt/lt_slot.h
|
2017-11-30 17:52:59 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(nothing ${SOURCE_FILES} ${HEADER_FILES})
|
2018-08-27 04:52:11 -07:00
|
|
|
add_executable(nothing_test
|
2018-09-02 05:14:19 -07:00
|
|
|
src/script/builtins.c
|
|
|
|
src/script/builtins.h
|
2018-08-28 05:55:01 -07:00
|
|
|
src/script/expr.c
|
|
|
|
src/script/expr.h
|
2018-09-02 05:14:19 -07:00
|
|
|
src/script/interpreter.c
|
|
|
|
src/script/interpreter.h
|
2018-08-28 05:55:01 -07:00
|
|
|
src/script/parser.c
|
|
|
|
src/script/parser.h
|
2018-09-02 05:14:19 -07:00
|
|
|
src/script/scope.c
|
|
|
|
src/script/scope.h
|
2018-08-27 04:52:11 -07:00
|
|
|
src/script/tokenizer.c
|
|
|
|
src/script/tokenizer.h
|
2018-08-28 05:55:01 -07:00
|
|
|
src/system/error.c
|
|
|
|
src/system/error.h
|
2018-09-02 05:14:19 -07:00
|
|
|
src/system/lt.c
|
|
|
|
src/system/lt.h
|
2018-08-28 05:55:01 -07:00
|
|
|
src/system/lt/lt_adapters.c
|
|
|
|
src/system/lt/lt_adapters.h
|
|
|
|
src/system/lt/lt_slot.c
|
|
|
|
src/system/lt/lt_slot.h
|
2018-08-27 04:52:11 -07:00
|
|
|
test/main.c
|
2018-08-28 05:55:01 -07:00
|
|
|
test/test.h
|
|
|
|
test/tokenizer_suite.h
|
2018-08-27 04:52:11 -07:00
|
|
|
)
|
2018-07-14 11:28:20 -07:00
|
|
|
target_link_libraries(nothing ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY})
|
2018-08-28 05:55:01 -07:00
|
|
|
target_link_libraries(nothing_test ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY})
|
2017-12-09 21:02:44 -08:00
|
|
|
|
|
|
|
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG"))
|
2017-12-14 05:40:04 -08:00
|
|
|
set(CMAKE_C_FLAGS
|
|
|
|
"${CMAKE_C_FLAGS} \
|
|
|
|
-Wall \
|
|
|
|
-Werror \
|
|
|
|
-Wextra \
|
|
|
|
-Wconversion \
|
|
|
|
-Wunused \
|
|
|
|
-Wunused-function \
|
|
|
|
-Wunused-label \
|
|
|
|
-Wunused-macros \
|
|
|
|
-Wunused-parameter \
|
|
|
|
-Wunused-value \
|
|
|
|
-Wunused-variable \
|
|
|
|
-Wcast-align \
|
|
|
|
-Wcast-qual \
|
|
|
|
-Wmissing-declarations \
|
|
|
|
-Wredundant-decls \
|
|
|
|
-Wmissing-prototypes \
|
|
|
|
-Wnested-externs \
|
|
|
|
-Wpointer-arith \
|
|
|
|
-Wshadow \
|
|
|
|
-Wstrict-prototypes \
|
|
|
|
-Wwrite-strings \
|
2018-06-02 09:36:23 -07:00
|
|
|
-Wswitch \
|
2018-08-25 10:59:29 -07:00
|
|
|
-Wmissing-field-initializers \
|
2017-12-14 05:40:04 -08:00
|
|
|
-fno-common \
|
|
|
|
-pedantic \
|
|
|
|
-std=c11 \
|
|
|
|
-O3")
|
2017-12-09 21:02:44 -08:00
|
|
|
target_link_libraries(nothing m)
|
|
|
|
endif()
|
|
|
|
if(WIN32)
|
|
|
|
target_link_libraries(nothing Imm32 Version winmm)
|
|
|
|
endif()
|
2018-03-16 03:09:39 -07:00
|
|
|
|
2018-03-22 12:38:49 -07:00
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/sounds DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
2018-07-08 10:25:33 -07:00
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/fonts DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
2018-08-28 05:55:01 -07:00
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test-data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|