-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
83 lines (71 loc) · 1.21 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
cmake_minimum_required(VERSION 3.13)
project(jcc C)
set(CMAKE_C_STANDARD 23)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
set(
SOURCE_FILES
main.c
vector.c
alloc.c
log.c
graphwriter.c
compiler.c
diagnostics.c
lex.c
parse.c
preproc.c
program.c
link.c
lower.c
liveness.c
disasm.c
codegen.c
hashtbl.c
bitset.c
var_table.c
typechk.c
lsra.c
graphcol.c
ir/ir.c
ir/build.c
ir/var_refs.c
ir/eliminate_phi.c
ir/prettyprint.c
aarch64.c
aarch64/codegen.c
aarch64/lower.c
aarch64/emit.c
aarch64/emitter.c
# riscv.c
# riscv/codegen.c
# riscv/lower.c
# riscv/emit.c
# riscv/emitter.c
# eep.c
# eep/codegen.c
# eep/lower.c
# eep/emit.c
# eep/emitter.c
# eep/object.c
# eep/disasm.c
macos/mach-o.c
macos/mach-o.c
)
if(MSVC)
add_compile_option(/W4 /WX)
else()
add_link_options(-fsanitize=address,undefined)
add_compile_options(-fsanitize=address,undefined)
add_compile_options(
-Wall
-Wextra
-Wpedantic
-Werror
-Wimplicit-fallthrough
-Wstrict-prototypes
-Wmissing-field-initializers
)
# TODO: remove binary literals in source
add_compile_options(-Wno-gnu-binary-literal)
endif()
add_executable(jcc ${SOURCE_FILES})