-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
45 lines (38 loc) · 1.15 KB
/
Copy pathCMakeLists.txt
File metadata and controls
45 lines (38 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.24)
project(mora VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Library files
add_library(mora_lib STATIC
src/lexer/token.cpp
src/lexer/scanner.cpp
# src/parser/parser.cpp
# src/ast/ast.cpp
# src/interpreter/interpreter.cpp
# src/arena/arena.cpp
)
target_include_directories(mora_lib PUBLIC src)
target_compile_options(mora_lib PRIVATE -Wall -Wextra -Wpedantic)
# Main executables
# add_executable(mora src/main.cpp)
# target_link_libraries(mora PRIVATE mora_lib)
# Tests
# find_package(Catch2 3 QUIET)
# if(NOT Catch2_FOUND)
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.15.0
)
FetchContent_MakeAvailable(Catch2)
# endif()
file(GLOB_RECURSE TEST_SOURCES tests/*.cpp)
add_executable(mora_tests ${TEST_SOURCES})
target_link_libraries(mora_tests PRIVATE mora_lib Catch2::Catch2WithMain)
target_compile_options(mora_tests PRIVATE -Wall -Wextra -Wpedantic)
include(CTest)
add_test(NAME mora_tests COMMAND mora_tests)
# Show failures inline
set(CTEST_OUTPUT_ON_FAILURE ON)