-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
105 lines (90 loc) · 1.72 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
cmake_minimum_required(VERSION 3.13)
project(jcc C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS 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
-Weverything
-Werror
-Wno-error=unreachable-code-loop-increment
-Wno-error=unused-parameter
-Wno-error=covered-switch-default
-Wmissing-prototypes
-Wsign-conversion
-Wimplicit-fallthrough
-Wstrict-prototypes
-Wmissing-field-initializers
-Wno-missing-noreturn
-Wno-unused-macros
-Wno-switch-enum
-Wno-bad-function-cast
-Wno-undef
-Wno-padded
-Wno-declaration-after-statement
-Wno-class-varargs
-Wno-sign-conversion
-Wno-conditional-uninitialized
-Wno-shorten-64-to-32
-Wno-assign-enum
)
# TODO: remove binary literals in source
add_compile_options(-Wno-gnu-binary-literal)
endif()
add_executable(jcc ${SOURCE_FILES})