-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (43 loc) · 1.73 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
cmake_minimum_required(VERSION 3.27)
project(dust-lang)
find_package(GTest REQUIRED)
find_package(LLVM REQUIRED CONFIG)
option(BUILD_TESTS "Build tests" ON)
set(CMAKE_CXX_STANDARD 20)
include_directories(${LLVM_INCLUDE_DIRS})
add_executable(dust-lang
main.cpp
source/lexer/lexer.hpp
source/lexer/lexer.cpp
source/token/token_type.hpp
source/token/token.cpp
source/token/token.hpp
source/token/token_buffer/token_buffer.cpp
source/token/token_buffer/token_buffer.hpp
source/compiler/llvm_compiler.hpp
source/compiler/llvm_compiler.cpp
source/compiler/llvm_executable_builder.hpp
source/compiler/llvm_executable_builder.cpp
)
llvm_map_components_to_libnames(llvm_libs support core irreader)
target_link_libraries(dust-lang ${llvm_libs})
enable_testing()
if(BUILD_TESTS)
add_executable(dust-lang-tests
test/tests.cpp
source/lexer/lexer.hpp
source/lexer/lexer.cpp
source/token/token_type.hpp
source/token/token.cpp
source/token/token.hpp
source/token/token_buffer/token_buffer.cpp
source/token/token_buffer/token_buffer.hpp
source/compiler/llvm_compiler.hpp
source/compiler/llvm_compiler.cpp
source/compiler/llvm_executable_builder.hpp
source/compiler/llvm_executable_builder.cpp
)
target_link_libraries(dust-lang-tests ${GTEST_LIBRARIES} pthread)
target_link_libraries(dust-lang-tests ${llvm_libs})
add_test(NAME dust-lang-tests COMMAND dust-lang-tests)
endif()