valeri/CMakeLists.txt

99 lines
1.8 KiB
Text
Raw Normal View History

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
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
src/utf8.cpp
src/compiler.cpp
2024-08-11 01:25:44 +00:00
src/opcode.cpp
src/fio.cpp
src/stdlib.cpp
2024-08-26 12:16:05 +00:00
src/lineedit.cpp
src/serialize.cpp
PUBLIC
FILE_SET HEADERS
BASE_DIRS src
FILES
src/arena.hpp
src/common.hpp
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
src/utf8.hpp
src/compiler.hpp
2024-08-10 17:24:16 +00:00
src/opcode.hpp
src/fio.hpp
src/stdlib.hpp
2024-08-26 12:16:05 +00:00
src/lineedit.hpp
src/serialize.hpp
)
2024-09-01 15:13:28 +00:00
add_executable(valeri src/valeri.cpp)
target_link_libraries(valeri vm_lib)
2024-09-01 15:13:28 +00:00
install(TARGETS valeri)
# TESTING
enable_testing()
set(CPP_TESTS
dict
2024-08-03 23:33:17 +00:00
array
2024-08-04 00:03:01 +00:00
symbol
string
)
set(LISP_TESTS
numeric
logic
dict
function
collections
continuations
serialize
)
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()
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'"
)
endforeach()