-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
85 lines (73 loc) · 1.74 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
PROJECT(bddd VERSION 0.1)
SET(CMAKE_CXX_STANDARD 17)
include_directories(include)
FIND_PACKAGE(BISON)
FIND_PACKAGE(FLEX)
BISON_TARGET(MyParser
src/parser/parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.hh
)
FLEX_TARGET(
MyScanner
src/parser/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/lexer.hh
)
ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
set(PARSER_SOURCE
${BISON_MyParser_OUTPUTS}
${FLEX_MyScanner_OUTPUTS}
src/parser/driver.cpp
)
set(AST_SOURCE
src/ast/ast.cpp
src/ast/symbol-table.cpp
src/ast/type-check.cpp
src/ast/debug.cpp
src/ast/codegen.cpp
)
set(IR_SOURCE
src/ir/ir.cpp
src/ir/export.cpp
src/ir/builder.cpp
src/ir/ir-name-allocator.cpp
)
set(IR_PASSES
src/ir/pass/mem2reg.cpp
src/ir/pass/function-inlining.cpp
src/ir/pass/gvn.cpp
src/ir/pass/gcm.cpp
src/ir/pass/dce.cpp
src/ir/pass/side-effect.cpp
src/ir/pass/dom.cpp
src/ir/pass/basic.cpp
src/ir/pass/tail-recursion.cpp
src/ir/pass/loop-detection.cpp
src/ir/pass/strength-reduction.cpp
src/ir/pass/loop-unrolling.cpp
src/ir/pass/loop-analysis.cpp
src/ir/pass/global-const.cpp
src/ir/pass/load.cpp
src/ir/pass/instr-combine.cpp
src/ir/pass/lcssa.cpp
src/ir/pass/loop-simplify.cpp
)
set(ASM_SOURCE
src/asm/asm.cpp
src/asm/asm-builder.cpp
src/asm/asm-codegen.cpp
src/asm/asm-export.cpp
src/asm/asm-liveness.cpp
src/asm/asm-register.cpp
src/asm/asm-fixed.cpp
src/asm/asm-optimization.cpp
)
add_executable(bddd
src/main.cpp
${PARSER_SOURCE}
${AST_SOURCE}
${IR_SOURCE}
${IR_PASSES}
${ASM_SOURCE}
)
target_include_directories(bddd PRIVATE ${CMAKE_CURRENT_BINARY_DIR})