blob: c54f9ce6f9f883859958df9917bf9dd8b82c2961 (
plain)
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
# _______ ___ ___ _______ __ __
# | | | | | | .----.-----.--------.-----.|__| |.-----.----.
# | - _| | | | | __| _ | | _ || | || -__| _|
# |_______|\_____/|__|_|__| |____|_____|__|__|__| __||__|__||_____|__|
# |__|
# TODO: DO NOT build unless building a QVM
# _ _
# | || |
# | || | ,_ __,
# |/ |/ \_| | / | / |
# |__/\_/ \_/|_/ |_/\_/|/
# /|
# \|
add_executable(
lburg
lcc/lburg/lburg.c
lcc/lburg/gram.c
)
# ___
# / \
# __, __/ __, , _ _ _
# / | \/ | / \_/ |/ |/ |
# \_/|_/\___/\_/|_/ \/ | | |_/
# |\
# |/
#
add_executable(
q3asm
asm/q3asm.c
asm/cmdlib.c
)
target_include_directories( q3asm PUBLIC lcc/src lcc/lburg )
# ___ _
# / \| |
# __, __/| | __ __
# / | \|/ / /
# \_/|_/\___/|__/\___/\___/
# |\
# |/
#
add_executable(
q3lcc
lcc/etc/bytecode.c
lcc/etc/lcc.c
)
target_include_directories( q3lcc PUBLIC lcc/src lcc/lburg )
# ___
# / \
# __, __/ __ _ _
#/ | \/ |/ \_|/ \_
#\_/|_/\___/\___/|__/ |__/
# |\ /| /|
# |/ \| \|
#
add_executable(
q3cpp
#
lcc/cpp/cpp.c
lcc/cpp/lex.c
lcc/cpp/nlist.c
lcc/cpp/tokens.c
lcc/cpp/macro.c
lcc/cpp/eval.c
lcc/cpp/include.c
lcc/cpp/hideset.c
lcc/cpp/getopt.c
lcc/cpp/unix.c
)
target_include_directories( q3cpp PUBLIC lcc/src lcc/lburg )
# ___
# / \
# __, __/ ,_ __ __
# / | \/ | / /
# \_/|_/\___/ |_/\___/\___/
# |\
# |/
#
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dagcheck.c
COMMAND lburg
ARGS ${CMAKE_CURRENT_SOURCE_DIR}/lcc/src/dagcheck.md dagcheck.c
DEPENDS lburg lcc/src/dagcheck.md
)
set_source_files_properties(dagcheck.c PROPERTIES GENERATED TRUE)
add_executable(
q3rcc
lcc/src/alloc.c
lcc/src/bind.c
lcc/src/bytecode.c
lcc/src/dag.c
${CMAKE_CURRENT_BINARY_DIR}/dagcheck.c
lcc/src/decl.c
lcc/src/enode.c
lcc/src/error.c
lcc/src/event.c
lcc/src/expr.c
lcc/src/gen.c
lcc/src/init.c
lcc/src/inits.c
lcc/src/input.c
lcc/src/lex.c
lcc/src/list.c
lcc/src/main.c
lcc/src/null.c
lcc/src/output.c
lcc/src/prof.c
lcc/src/profio.c
lcc/src/simp.c
lcc/src/stmt.c
lcc/src/string.c
lcc/src/sym.c
lcc/src/symbolic.c
lcc/src/trace.c
lcc/src/tree.c
lcc/src/types.c
)
target_include_directories( q3rcc PUBLIC lcc/src lcc/lburg )
set_property(
TARGET lburg q3asm q3lcc q3cpp q3rcc
PROPERTY RUNTIME_OUTPUT_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qvm_tools
)
# Victor Roemer (wtfbbqhax), <victor@badsec.org>.
cmake_minimum_required(VERSION 3.5)
project(QVMCompiler C)
|