-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
165 lines (118 loc) · 3.81 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
cmake_minimum_required(VERSION 3.15)
project(WeakMemoryModelsSimulator CXX)
#### setting global props
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
#### Setting targets
set(SIMULATOR_TARGET simulator)
set(TESTS_TARGET tests)
#### compile options for all targets
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options() #-Wall -Wextra -Werror # why these cause the build crash -fsanitize=address -fsanitize=leak ?
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/W4 /WX)
endif()
set(SIMULATOR_SRCS
src/file-reader/file-reader.cpp
src/file-reader/file-reader.h
src/args-parser/args-parser.h
src/exceptions/exceptions.h
src/utils/utils.cpp
src/utils/utils.h
src/utils/node-stringifier/node-stringifier.cpp
src/utils/node-stringifier/node-stringifier.h
src/utils/node-evaluator/node-evaluator.cpp
src/utils/node-evaluator/node-evaluator.h
src/parser/parser.cpp
src/parser/parser.h
src/lexer/lexer.cpp
src/lexer/lexer.h
src/lexer/token.cpp
src/lexer/token.h
src/lang/keywords.h
src/lang/memory-order.h
src/visitor/visitor.h
src/interpreter/interpreter.cpp
src/interpreter/interpreter.h
src/interpreter/non-deterministic/non-deterministic.cpp
src/interpreter/non-deterministic/non-deterministic.h
src/interpreter/tracing/tracing.cpp
src/interpreter/tracing/tracing.h
src/interpreter/interactive/interactive.cpp
src/interpreter/interactive/interactive.h
src/interpreter/interactive/interactive-cli.cpp
src/interpreter/interactive/interactive-cli.h
src/interpreter/model-checking/model-checking.cpp
src/interpreter/model-checking/model-checking.h
src/state/program-state.cpp
src/state/program-state.h
src/thread-subsystem/thread-subsystem.cpp
src/thread-subsystem/thread-subsystem.h
# storage subsystems
src/storage-subsystem/storage-subsystem.h
src/storage-subsystem/sc/sc-storage-subsystem.cpp
src/storage-subsystem/sc/sc-storage-subsystem.h
src/storage-subsystem/tso/tso-storage-subsystem.cpp
src/storage-subsystem/tso/tso-storage-subsystem.h
src/storage-subsystem/pso/pso-storage-subsystem.cpp
src/storage-subsystem/pso/pso-storage-subsystem.h
src/storage-subsystem/sra/sra-storage-subsystem.cpp
src/storage-subsystem/sra/sra-storage-subsystem.h
# ast nodes
src/ast/node.h
src/ast/program/program.cpp
src/ast/program/program.h
src/ast/statement/statement.cpp
src/ast/statement/statement.h
src/ast/assignment/assignment.cpp
src/ast/assignment/assignment.h
src/ast/binop/binop.cpp
src/ast/binop/binop.h
src/ast/number/number.cpp
src/ast/number/number.h
src/ast/condition/condition.cpp
src/ast/condition/condition.h
src/ast/goto/goto.cpp
src/ast/goto/goto.h
src/ast/thread-goto/thread-goto.cpp
src/ast/thread-goto/thread-goto.h
src/ast/load/load.cpp
src/ast/load/load.h
src/ast/store/store.cpp
src/ast/store/store.h
src/ast/cas/cas.cpp
src/ast/cas/cas.h
src/ast/fai/fai.cpp
src/ast/fai/fai.h
src/ast/fence/fence.cpp
src/ast/fence/fence.h
src/ast/end/end.cpp
src/ast/end/end.h
)
set(TESTS_SRCS
tests/common.h
tests/test-lexer.cpp
tests/test-parser.cpp
tests/test-sc.cpp
tests/test-tso.cpp
tests/test-pso.cpp
tests/test-sra.cpp
${SIMULATOR_SRCS}
)
#### configuring SIMULATOR_TARGET
add_executable(${SIMULATOR_TARGET}
src/main.cpp
${SIMULATOR_SRCS}
)
target_include_directories(${SIMULATOR_TARGET} PUBLIC
src
)
#### configuring TESTS_TARGET:
add_executable(${TESTS_TARGET}
src/doctest-main.cpp
${TESTS_SRCS}
)
target_include_directories(${TESTS_TARGET} PUBLIC
./doctest
src
)