2017-12-01 21:26:06 -08:00
|
|
|
cmake_minimum_required(VERSION 3.2)
|
2017-11-30 17:52:59 -08:00
|
|
|
project(nothing)
|
|
|
|
|
2019-05-25 04:58:13 -07:00
|
|
|
if(WIN32)
|
2019-05-25 06:29:35 -07:00
|
|
|
set(SDL2_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/SDL2/include")
|
2019-05-25 04:58:13 -07:00
|
|
|
|
|
|
|
# Support both 32 and 64 bit builds
|
|
|
|
if (${CMAKE_SIZEOF_VOID_P} MATCHES 8)
|
|
|
|
set(SDL2_LIBRARIES "${CMAKE_SOURCE_DIR}/SDL2/lib/x64/SDL2.lib;${CMAKE_SOURCE_DIR}/SDL2/lib/x64/SDL2main.lib")
|
|
|
|
else()
|
|
|
|
set(SDL2_LIBRARIES "${CMAKE_SOURCE_DIR}/SDL2/lib/x86/SDL2.lib;${CMAKE_SOURCE_DIR}/SDL2/lib/x86/SDL2main.lib")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
|
|
|
|
else()
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
endif()
|
2018-03-01 13:03:56 -08:00
|
|
|
|
2019-06-27 07:28:45 -07:00
|
|
|
if("${SDL2_LIBRARIES}" STREQUAL "")
|
|
|
|
message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
|
|
|
|
set(SDL2_LIBRARIES "SDL2::SDL2")
|
|
|
|
endif()
|
|
|
|
|
2019-02-02 10:26:03 -08:00
|
|
|
include_directories(${CMAKE_BINARY_DIR})
|
2018-04-29 05:45:50 -07:00
|
|
|
include_directories(src/)
|
2018-12-17 07:27:15 -08:00
|
|
|
|
2019-05-25 06:29:35 -07:00
|
|
|
include_directories(${SDL2_INCLUDE_DIRS})
|
2018-12-17 07:27:15 -08:00
|
|
|
|
2019-02-02 12:13:39 -08:00
|
|
|
add_library(system STATIC
|
|
|
|
src/system/line_stream.c
|
|
|
|
src/system/line_stream.h
|
|
|
|
src/system/log.c
|
|
|
|
src/system/log.h
|
|
|
|
src/system/log_script.c
|
|
|
|
src/system/log_script.h
|
|
|
|
src/system/lt.h
|
|
|
|
src/system/nth_alloc.c
|
|
|
|
src/system/nth_alloc.h
|
|
|
|
src/system/stacktrace.c
|
|
|
|
src/system/stacktrace.h
|
|
|
|
src/system/str.c
|
|
|
|
src/system/str.h
|
2019-02-24 11:11:11 -08:00
|
|
|
src/dynarray.h
|
|
|
|
src/dynarray.c
|
2019-03-02 10:22:03 -08:00
|
|
|
src/hashset.h
|
|
|
|
src/hashset.c
|
2019-02-02 12:13:39 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(ebisp STATIC
|
|
|
|
src/ebisp/builtins.c
|
|
|
|
src/ebisp/builtins.h
|
2018-10-26 09:19:42 -07:00
|
|
|
src/ebisp/expr.c
|
2019-02-02 12:13:39 -08:00
|
|
|
src/ebisp/expr.h
|
|
|
|
src/ebisp/gc.c
|
|
|
|
src/ebisp/gc.h
|
2018-10-26 09:19:42 -07:00
|
|
|
src/ebisp/interpreter.c
|
2019-02-02 12:13:39 -08:00
|
|
|
src/ebisp/interpreter.h
|
2018-10-26 09:19:42 -07:00
|
|
|
src/ebisp/parser.c
|
2019-02-02 12:13:39 -08:00
|
|
|
src/ebisp/parser.h
|
2018-10-26 09:19:42 -07:00
|
|
|
src/ebisp/scope.c
|
2019-02-02 12:13:39 -08:00
|
|
|
src/ebisp/scope.h
|
|
|
|
src/ebisp/std.c
|
|
|
|
src/ebisp/std.h
|
|
|
|
src/ebisp/tokenizer.c
|
|
|
|
src/ebisp/tokenizer.h
|
|
|
|
)
|
2019-05-20 09:23:15 -07:00
|
|
|
target_link_libraries(ebisp system)
|
2019-02-02 12:13:39 -08:00
|
|
|
|
|
|
|
add_executable(nothing
|
|
|
|
src/broadcast.c
|
|
|
|
src/broadcast.h
|
|
|
|
src/color.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/color.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game.c
|
2017-12-16 09:41:14 -08:00
|
|
|
src/game.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/camera.c
|
2018-05-02 21:43:54 -07:00
|
|
|
src/game/camera.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level.c
|
2018-04-29 05:48:11 -07:00
|
|
|
src/game/level.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/background.c
|
2018-04-29 12:15:15 -07:00
|
|
|
src/game/level/background.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/boxes.c
|
2018-07-01 09:29:07 -07:00
|
|
|
src/game/level/boxes.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/goals.c
|
2018-04-29 05:59:16 -07:00
|
|
|
src/game/level/goals.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/labels.c
|
2018-07-22 12:09:40 -07:00
|
|
|
src/game/level/labels.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/lava.c
|
2018-04-29 06:01:01 -07:00
|
|
|
src/game/level/lava.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/lava/wavy_rect.c
|
2018-04-29 06:03:56 -07:00
|
|
|
src/game/level/lava/wavy_rect.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/platforms.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/game/level/platforms.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/player.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/game/level/player.h
|
2019-02-16 12:48:36 -08:00
|
|
|
src/game/level/explosion.c
|
|
|
|
src/game/level/explosion.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/level/regions.c
|
|
|
|
src/game/level/regions.h
|
|
|
|
src/game/level/rigid_bodies.c
|
|
|
|
src/game/level/rigid_bodies.h
|
|
|
|
src/game/level/script.c
|
|
|
|
src/game/level/script.h
|
|
|
|
src/game/level_picker.c
|
|
|
|
src/game/level_picker.h
|
2019-03-09 10:43:12 -08:00
|
|
|
src/game/level_folder.h
|
|
|
|
src/game/level_folder.c
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/sound_samples.c
|
2018-05-03 05:53:21 -07:00
|
|
|
src/game/sound_samples.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/game/sprite_font.c
|
2018-07-14 11:22:38 -07:00
|
|
|
src/game/sprite_font.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/main.c
|
|
|
|
src/math/extrema.c
|
|
|
|
src/math/extrema.h
|
|
|
|
src/math/mat3x3.c
|
2018-04-29 06:14:14 -07:00
|
|
|
src/math/mat3x3.h
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/pi.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/math/point.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/point.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/math/rand.c
|
2018-04-29 06:12:50 -07:00
|
|
|
src/math/rand.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/math/rect.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/rect.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/math/triangle.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/math/triangle.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/sdl/renderer.c
|
2018-04-29 06:59:56 -07:00
|
|
|
src/sdl/renderer.h
|
2019-03-30 12:03:44 -07:00
|
|
|
src/sdl/texture.h
|
|
|
|
src/sdl/texture.c
|
2019-02-02 12:13:39 -08:00
|
|
|
src/ui/console.c
|
2018-09-30 09:39:40 -07:00
|
|
|
src/ui/console.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/ui/console_log.c
|
2018-11-05 05:27:31 -08:00
|
|
|
src/ui/console_log.h
|
2019-02-02 12:13:39 -08:00
|
|
|
src/ui/edit_field.c
|
|
|
|
src/ui/edit_field.h
|
|
|
|
src/ui/history.c
|
2018-10-07 10:55:16 -07:00
|
|
|
src/ui/history.h
|
2019-03-09 08:57:56 -08:00
|
|
|
src/ui/list_selector.h
|
|
|
|
src/ui/list_selector.c
|
2019-03-10 10:32:53 -07:00
|
|
|
src/ui/menu_title.h
|
|
|
|
src/ui/menu_title.c
|
2019-03-16 09:47:01 -07:00
|
|
|
src/game/level_metadata.h
|
|
|
|
src/game/level_metadata.c
|
2019-04-07 11:35:35 -07:00
|
|
|
src/game/level/level_editor/proto_rect.h
|
|
|
|
src/game/level/level_editor/proto_rect.c
|
2019-04-07 11:19:09 -07:00
|
|
|
src/game/level/level_editor.h
|
|
|
|
src/game/level/level_editor.c
|
2019-04-07 12:20:48 -07:00
|
|
|
src/game/level/level_editor/color_picker.h
|
|
|
|
src/game/level/level_editor/color_picker.c
|
2019-05-19 09:27:55 -07:00
|
|
|
src/game/level/level_editor/rect_layer.h
|
|
|
|
src/game/level/level_editor/rect_layer.c
|
2019-04-28 11:49:55 -07:00
|
|
|
src/game/level/level_editor/layer_picker.h
|
|
|
|
src/game/level/level_editor/layer_picker.c
|
2019-05-04 10:58:00 -07:00
|
|
|
src/game/level/level_editor/point_layer.h
|
|
|
|
src/game/level/level_editor/point_layer.c
|
2019-05-19 09:59:28 -07:00
|
|
|
src/game/level/level_editor/player_layer.h
|
|
|
|
src/game/level/level_editor/player_layer.c
|
2019-05-19 11:56:02 -07:00
|
|
|
src/game/level/level_editor/layer.h
|
|
|
|
src/game/level/level_editor/layer.c
|
2019-06-09 09:52:20 -07:00
|
|
|
src/game/level/level_editor/label_layer.c
|
|
|
|
src/game/level/level_editor/label_layer.h
|
2019-06-15 11:00:59 -07:00
|
|
|
src/system/file.h
|
|
|
|
src/system/file.c
|
2017-11-30 17:52:59 -08:00
|
|
|
)
|
2019-05-25 05:28:32 -07:00
|
|
|
target_link_libraries(nothing ${SDL2_LIBRARIES} system ebisp)
|
2017-11-30 17:52:59 -08:00
|
|
|
|
2018-09-02 11:28:34 -07:00
|
|
|
add_executable(repl
|
2018-10-26 09:19:42 -07:00
|
|
|
src/ebisp/repl.c
|
2018-11-25 10:01:48 -08:00
|
|
|
src/ebisp/repl_runtime.c
|
2018-09-02 11:28:34 -07:00
|
|
|
)
|
2019-05-25 05:28:32 -07:00
|
|
|
target_link_libraries(repl ${SDL2_LIBRARIES} system ebisp)
|
2019-02-02 12:13:39 -08:00
|
|
|
|
2018-08-27 04:52:11 -07:00
|
|
|
add_executable(nothing_test
|
|
|
|
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
|
|
|
)
|
2019-05-25 05:28:32 -07:00
|
|
|
target_link_libraries(nothing_test ${SDL2_LIBRARIES} system ebisp)
|
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 \
|
2019-05-19 12:26:22 -07:00
|
|
|
-ggdb \
|
2017-12-14 05:40:04 -08:00
|
|
|
-O3")
|
2017-12-09 21:02:44 -08:00
|
|
|
target_link_libraries(nothing m)
|
2019-06-23 08:42:48 -07:00
|
|
|
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
|
|
set(CMAKE_C_FLAGS
|
|
|
|
"${CMAKE_C_FLAGS} \
|
|
|
|
/Wall \
|
|
|
|
/WX \
|
2019-06-27 08:11:32 -07:00
|
|
|
/wd4127 \
|
2019-06-23 08:42:48 -07:00
|
|
|
/wd4201 \
|
|
|
|
/wd4204 \
|
|
|
|
/wd4255 \
|
|
|
|
/wd4668 \
|
2019-06-27 08:11:32 -07:00
|
|
|
/wd4702 \
|
2019-06-23 08:42:48 -07:00
|
|
|
/wd4710 \
|
|
|
|
/wd4777 \
|
|
|
|
/wd4820 \
|
|
|
|
/wd5045 \
|
|
|
|
/D \"_CRT_SECURE_NO_WARNINGS\"")
|
2017-12-09 21:02:44 -08:00
|
|
|
endif()
|
|
|
|
if(WIN32)
|
|
|
|
target_link_libraries(nothing Imm32 Version winmm)
|
|
|
|
endif()
|
2018-03-16 03:09:39 -07:00
|
|
|
|
2018-08-28 05:55:01 -07:00
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test-data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|