-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
131 lines (97 loc) · 2.27 KB
/
CMakeLists.txt
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
cmake_minimum_required(VERSION 3.20)
project(yapvm)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#add_compile_options(-fsanitize=address)
#add_link_options(-fsanitize=address)
include_directories(include)
include_directories(test_resources)
set(SOURCE_ALL
include/parser.h
src/parser.cpp
include/utils.h
src/utils.cpp
include/ast.h
src/ast.cpp
include/y_objects.h
src/y_objects.cpp
include/gc.h
src/gc.cpp
include/interpreter.h
src/interpreter.cpp
include/allocator.h
src/allocator.cpp
include/kvstorage.h
include/kvstorage_element.h
include/scope.h
src/scope.cpp
include/thread_manager.h
src/thread_manager.cpp
include/logger.h
src/logger.cpp
)
add_executable(yapvm
src/main.cpp
${SOURCE_ALL}
)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_executable(y_object_test
test/y_object_test.cpp
${SOURCE_ALL}
)
add_executable(ygc_test
test/ygc_test.cpp
${SOURCE_ALL}
)
add_executable(parser_test
test/parser_test.cpp
${SOURCE_ALL}
)
add_executable(kv_storage_test
test/kv_storage_test.cpp
${SOURCE_ALL}
)
add_executable(scope_test
test/scope_test.cpp
${SOURCE_ALL}
)
add_executable(interpreter_test
test/interpreter_test.cpp
${SOURCE_ALL}
)
target_link_libraries(
y_object_test
GTest::gtest_main
)
target_link_libraries(
ygc_test
GTest::gtest_main
)
target_link_libraries(
parser_test
GTest::gtest_main
)
target_link_libraries(
kv_storage_test
GTest::gtest_main
)
target_link_libraries(
scope_test
GTest::gtest_main
)
target_link_libraries(
interpreter_test
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(y_object_test)
gtest_discover_tests(ygc_test)
gtest_discover_tests(parser_test)
gtest_discover_tests(kv_storage_test)
gtest_discover_tests(interpreter_test)