-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathCMakeLists.txt
68 lines (53 loc) · 1.43 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
cmake_minimum_required(VERSION 3.16)
SET(CMAKE_CXX_COMPILER /usr/bin/clang++)
project(SYSYCompiler)
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
# Import LLVM
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
llvm_map_components_to_libnames(
llvm_libs
all
)
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
# Import LLVM
INCLUDE_DIRECTORIES(include/front)
include_directories(include/syntax_tree)
include_directories(include)
include_directories(include/IR)
include_directories(include/IRBuilder)
include_directories(include/CodeGen)
include_directories(include/OptimizePass)
#include_directories(include/llvm-builder)
include_directories(include/HIR)
add_subdirectory(src/front)
add_subdirectory(src/syntax_tree)
add_subdirectory(src/IRBuilder)
add_subdirectory(src/IR)
add_subdirectory(src/CodeGen)
add_subdirectory(src/OptimizePass)
#add_subdirectory(src/llvm-builder)
set(CMAKE_CXX_STANDARD 17)
add_executable(
compiler
src/main.cc
)
target_link_libraries(
compiler
IRBuilder
driver
IR_lib
Pass
CodeGen
# ControlTree
ActiveVars
RegisterAllocation
)
install(
TARGETS compiler
RUNTIME DESTINATION bin
)