X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=CMakeLists.txt;h=3f29c2e2ec40e6522c789bffd1a6526872a9d378;hb=0bbefa2e98126636b98a0efccf43faf9f4ec2850;hp=13963e8da3a0836f727c95d084026b03b3156653;hpb=ada5157a7a2da6aebfcdf7901efcea0e450e4467;p=nothing.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 13963e8d..3f29c2e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,11 +43,18 @@ set(SOURCE_FILES src/math/rand.c src/math/rect.c src/math/triangle.c + src/script/expr.c + src/script/interpreter.c + src/script/parser.c + src/script/tokenizer.c + src/script/gc.c + src/script/scope.c src/sdl/renderer.c src/system/error.c src/system/lt.c src/system/lt/lt_adapters.c src/system/lt/lt_slot.c + src/game/level/console.c ) set(HEADER_FILES @@ -78,15 +85,78 @@ set(HEADER_FILES src/math/rand.h src/math/rect.h src/math/triangle.h + src/script/builtins.c + src/script/builtins.h + src/script/expr.h + src/script/gc.h + src/script/scope.h + src/script/interpreter.h + src/script/parser.h + src/script/tokenizer.h src/sdl/renderer.h src/system/error.h src/system/lt.h src/system/lt/lt_adapters.h src/system/lt/lt_slot.h + src/game/level/console.h ) add_executable(nothing ${SOURCE_FILES} ${HEADER_FILES}) +add_executable(repl + src/script/builtins.c + src/script/builtins.h + src/script/expr.c + src/script/expr.h + src/script/interpreter.c + src/script/interpreter.h + src/script/parser.c + src/script/parser.h + src/script/scope.c + src/script/scope.h + src/script/tokenizer.c + src/script/tokenizer.h + src/script/repl.c + src/system/lt.c + src/system/lt.h + src/system/lt/lt_adapters.c + src/system/lt/lt_adapters.h + src/system/lt/lt_slot.c + src/system/lt/lt_slot.h + src/system/error.c + src/system/error.h + src/script/gc.h + src/script/gc.c + ) +add_executable(nothing_test + src/script/builtins.c + src/script/builtins.h + src/script/expr.c + src/script/expr.h + src/script/interpreter.c + src/script/interpreter.h + src/script/parser.c + src/script/parser.h + src/script/scope.c + src/script/scope.h + src/script/tokenizer.c + src/script/tokenizer.h + src/script/gc.h + src/script/gc.c + src/system/error.c + src/system/error.h + src/system/lt.c + src/system/lt.h + src/system/lt/lt_adapters.c + src/system/lt/lt_adapters.h + src/system/lt/lt_slot.c + src/system/lt/lt_slot.h + test/main.c + test/test.h + test/tokenizer_suite.h + ) target_link_libraries(nothing ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY}) +target_link_libraries(nothing_test ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY}) +target_link_libraries(repl ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY}) if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG")) set(CMAKE_C_FLAGS @@ -113,6 +183,7 @@ if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" ST -Wstrict-prototypes \ -Wwrite-strings \ -Wswitch \ + -Wmissing-field-initializers \ -fno-common \ -pedantic \ -std=c11 \ @@ -125,3 +196,4 @@ endif() file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/sounds DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/fonts DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test-data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})