-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
45 lines (33 loc) · 1.2 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
# Seam Language Compiler
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)
project(Seam)
# Find LLVM Installation
find_package(LLVM CONFIG REQUIRED)
# Include LLVM includes and definitions
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
# Get rid of warnings
add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
# Create compiler executable
add_executable(compiler
src/main.cpp
src/seam/lexer/lexer.cpp
src/seam/parser/parser.cpp
src/seam/ir/ast/statement.cpp
src/seam/ir/ast/expression.cpp
src/seam/ir/ast/type.cpp
src/seam/code_generation/code_generation.cpp
src/seam/parser/passes/pass.cpp
"src/seam/parser/passes/function_collector.cpp"
"src/seam/parser/passes/function_resolver.cpp" "src/seam/parser/passes/types.cpp")
# Find the libraries that correspond to the LLVM components
# that we wish to use
llvm_map_components_to_libnames(LLVM_LIBS support core irreader ${LLVM_TARGETS_TO_BUILD})
# Link against LLVM libraries
target_link_libraries(compiler ${LLVM_LIBS})
# Test Suites
add_executable(lexer_test
src/tests/lexer_test_suite.cpp
src/seam/lexer/lexer.cpp "src/seam/parser/passes/types.cpp")
target_link_libraries(lexer_test ${LLVM_LIBS})