2024-07-19 01:29:30 +00:00
|
|
|
cmake_minimum_required(VERSION 3.28)
|
|
|
|
project(valeri) # vli
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
|
|
|
|
|
|
|
|
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
|
|
|
|
|
|
|
set (CMAKE_CXX_FLAGS "-fno-exceptions -static-libgcc -static-libstdc++ -Werror -Wall -Wunused-result -Wno-unused-function -Wno-unused-variable -fno-omit-frame-pointer -fsanitize=address -Wno-c99-designator")
|
|
|
|
|
|
|
|
add_library(vm_lib)
|
|
|
|
target_sources(vm_lib
|
|
|
|
PRIVATE
|
|
|
|
src/vm.cpp
|
|
|
|
src/common.cpp
|
2024-07-20 21:42:49 +00:00
|
|
|
src/arena.cpp
|
2024-08-10 10:17:20 +00:00
|
|
|
src/error.cpp
|
2024-07-27 15:25:44 +00:00
|
|
|
src/reader.cpp
|
2024-07-28 16:54:04 +00:00
|
|
|
src/writer.cpp
|
2024-07-28 15:40:52 +00:00
|
|
|
src/utf8.cpp
|
2024-07-30 22:52:23 +00:00
|
|
|
src/compiler.cpp
|
2024-08-11 01:25:44 +00:00
|
|
|
src/opcode.cpp
|
2024-08-18 19:01:40 +00:00
|
|
|
src/fio.cpp
|
2024-08-24 23:55:11 +00:00
|
|
|
src/stdlib.cpp
|
2024-08-26 12:16:05 +00:00
|
|
|
src/lineedit.cpp
|
2024-10-01 19:30:06 +00:00
|
|
|
src/serialize.cpp
|
2024-07-19 01:29:30 +00:00
|
|
|
|
|
|
|
PUBLIC
|
|
|
|
FILE_SET HEADERS
|
|
|
|
BASE_DIRS src
|
|
|
|
FILES
|
2024-07-20 21:42:49 +00:00
|
|
|
src/arena.hpp
|
2024-07-19 01:29:30 +00:00
|
|
|
src/common.hpp
|
2024-07-20 21:42:49 +00:00
|
|
|
src/error.hpp
|
|
|
|
src/pod.hpp
|
|
|
|
src/result.hpp
|
|
|
|
src/vm.hpp
|
2024-07-27 15:25:44 +00:00
|
|
|
src/sourcerange.hpp
|
|
|
|
src/reader.hpp
|
2024-07-28 16:54:04 +00:00
|
|
|
src/writer.hpp
|
2024-07-28 15:40:52 +00:00
|
|
|
src/utf8.hpp
|
2024-07-30 22:52:23 +00:00
|
|
|
src/compiler.hpp
|
2024-08-10 17:24:16 +00:00
|
|
|
src/opcode.hpp
|
2024-08-18 19:01:40 +00:00
|
|
|
src/fio.hpp
|
2024-08-24 23:55:11 +00:00
|
|
|
src/stdlib.hpp
|
2024-08-26 12:16:05 +00:00
|
|
|
src/lineedit.hpp
|
2024-10-01 19:30:06 +00:00
|
|
|
src/serialize.hpp
|
2024-07-19 01:29:30 +00:00
|
|
|
)
|
|
|
|
|
2024-09-01 15:13:28 +00:00
|
|
|
add_executable(valeri src/valeri.cpp)
|
|
|
|
target_link_libraries(valeri vm_lib)
|
2024-07-19 01:29:30 +00:00
|
|
|
|
2024-09-01 15:13:28 +00:00
|
|
|
install(TARGETS valeri)
|
2024-07-19 01:29:30 +00:00
|
|
|
|
|
|
|
# TESTING
|
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
|
|
|
|
set(CPP_TESTS
|
2024-08-01 17:56:38 +00:00
|
|
|
dict
|
2024-08-03 23:33:17 +00:00
|
|
|
array
|
2024-08-04 00:03:01 +00:00
|
|
|
symbol
|
2024-09-07 23:52:20 +00:00
|
|
|
string
|
2024-07-19 01:29:30 +00:00
|
|
|
)
|
|
|
|
|
2024-08-27 19:39:13 +00:00
|
|
|
set(LISP_TESTS
|
|
|
|
numeric
|
2024-08-27 21:31:13 +00:00
|
|
|
logic
|
2024-08-28 22:57:01 +00:00
|
|
|
dict
|
2024-08-29 22:14:33 +00:00
|
|
|
function
|
2024-09-01 22:02:21 +00:00
|
|
|
collections
|
2024-10-01 19:30:06 +00:00
|
|
|
continuations
|
|
|
|
serialize
|
2024-08-27 19:39:13 +00:00
|
|
|
)
|
|
|
|
|
2024-07-19 01:29:30 +00:00
|
|
|
|
|
|
|
foreach(testname IN LISTS CPP_TESTS)
|
|
|
|
add_executable("test_${testname}")
|
|
|
|
target_sources("test_${testname}" PRIVATE test/${testname}.cpp
|
|
|
|
PUBLIC
|
|
|
|
FILE_SET HEADERS
|
|
|
|
BASE_DIRS test
|
|
|
|
FILES
|
|
|
|
test/test.hpp)
|
|
|
|
target_link_libraries("test_${testname}" vm_lib)
|
|
|
|
|
|
|
|
add_test(
|
|
|
|
NAME "test_${testname}"
|
|
|
|
COMMAND $<TARGET_FILE:test_${testname}>
|
|
|
|
)
|
|
|
|
endforeach()
|
2024-08-27 19:39:13 +00:00
|
|
|
|
|
|
|
foreach(testname IN LISTS LISP_TESTS)
|
|
|
|
add_test(
|
|
|
|
NAME "test_lisp_${testname}"
|
2024-09-01 15:13:28 +00:00
|
|
|
COMMAND sh -c "$<TARGET_FILE:valeri> '${CMAKE_CURRENT_SOURCE_DIR}/test/${testname}.vli'"
|
2024-08-27 19:39:13 +00:00
|
|
|
)
|
|
|
|
endforeach()
|