56 lines
900 B
CMake
56 lines
900 B
CMake
cmake_minimum_required(VERSION 3.30)
|
|
project(camellya)
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
|
|
# Library sources
|
|
set(LIB_SOURCES
|
|
library.cpp
|
|
lexer.cpp
|
|
parser.cpp
|
|
value.cpp
|
|
interpreter.cpp
|
|
state.cpp
|
|
)
|
|
|
|
set(LIB_HEADERS
|
|
library.h
|
|
lexer.h
|
|
parser.h
|
|
ast.h
|
|
value.h
|
|
interpreter.h
|
|
state.h
|
|
)
|
|
|
|
# Build static library
|
|
add_library(camellya STATIC ${LIB_SOURCES} ${LIB_HEADERS})
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
Catch2
|
|
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
|
GIT_TAG v3.6.0
|
|
)
|
|
|
|
FetchContent_MakeAvailable(Catch2)
|
|
|
|
enable_testing()
|
|
|
|
add_executable(camellya_tests
|
|
tests/test_basic.cpp
|
|
)
|
|
|
|
target_include_directories(camellya_tests
|
|
PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
)
|
|
|
|
target_link_libraries(camellya_tests
|
|
PRIVATE
|
|
camellya
|
|
Catch2::Catch2WithMain
|
|
)
|
|
|
|
add_test(NAME camellya_tests COMMAND camellya_tests) |