-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
105 lines (90 loc) · 2.64 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
cmake_minimum_required(VERSION 3.21)
project(zhaba)
set(CMAKE_CXX_STANDARD 20)
include(FetchContent)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz)
FetchContent_MakeAvailable(json)
FetchContent_Declare(
cli11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11
GIT_TAG v2.2.0
)
FetchContent_MakeAvailable(cli11)
include_directories(src)
set(lib
src/compiler/compiler.hpp
src/compiler/tables.hpp
src/compiler/module_compiler.hpp
src/compiler/to_c.hpp
src/compiler/to_c.cpp
src/interpreter/bytecode.hpp
src/interpreter/heap.hpp
src/interpreter/instructions.hpp
src/interpreter/stack.hpp
src/interpreter/to_bytecode.hpp
src/interpreter/zhvm.hpp
src/lang/ast.hpp
src/lang/expression.hpp
src/lang/generics.hpp
src/lang/lang.hpp
src/lang/lang_tables.hpp
src/lang/scope.hpp
src/lang/scope.cpp
src/lang/syntax_tree.hpp
src/lang/module.cpp
src/lang/module.hpp
src/lang/token.cpp
src/lang/token.hpp
src/lang/types.hpp
src/lang/zhdata.hpp
src/libs/termcolor.hpp
src/parser/ast_parser.hpp
src/parser/definitions_parser.hpp
src/parser/expression_parser.hpp
src/parser/lexer.hpp
src/parser/parser.hpp
src/lang/parser_error.hpp
src/parser/preprocess.hpp
src/parser/syntax_tree_parser.hpp
src/parser/type_parser.hpp
src/tree_lib/Tree.hpp
src/tree_lib/TreePrinterASCII.hpp
src/tree_lib/TreeLib.hpp
src/lang/expression.cpp
src/lang/types.cpp
src/lang/ast.cpp
src/lang/generics.cpp
src/lang/syntax_tree.cpp
src/lang/parser_error.cpp
src/lang/zhdata.cpp
src/lang/lang_tables.cpp
src/interpreter/runtime_error.cpp
src/interpreter/runtime_error.hpp
src/parser/type_parser.cpp
src/parser/syntax_tree_parser.cpp
src/parser/definitions_parser.cpp
src/parser/expression_parser.cpp
src/parser/ast_parser.cpp
src/parser/lexer.cpp
src/parser/preprocess.cpp
src/interpreter/to_bytecode.cpp
src/interpreter/bytecode.cpp
src/interpreter/heap.cpp
src/interpreter/stack.cpp
src/zhaba/zhaba.hpp
)
add_executable(zhaba ${lib} src/zhaba/zhaba.cpp)
target_link_libraries(zhaba PRIVATE nlohmann_json::nlohmann_json)
install(TARGETS zhaba)
# ------------------- TESTS -------------------
# FetchContent_Declare(
# googletest
# URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
# )
# set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# FetchContent_MakeAvailable(googletest)
# enable_testing()
# add_executable(zhaba_test ${lib} tests/test.cpp)
# target_link_libraries(zhaba_test PRIVATE nlohmann_json::nlohmann_json gtest_main)
# include(GoogleTest)
# gtest_discover_tests(zhaba_test)