-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathBUILD
203 lines (168 loc) · 5.53 KB
/
BUILD
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#load("@build_stack_rules_proto//cpp:cpp_proto_library.bzl", "cpp_proto_library")
load("@build_stack_rules_proto//cpp:cpp_grpc_library.bzl", "cpp_grpc_library")
load("@build_stack_rules_proto//python:python_grpc_library.bzl", "python_grpc_library")
proto_library(
name = "access_service_proto",
srcs = ["src/pc_emulator/proto/mem_access.proto"],
deps = [],
visibility = ["//visibility:public"],
)
cpp_grpc_library(
name = "access_service_proto_cpp",
deps = [":access_service_proto"],
visibility = ["//visibility:public"],
)
python_grpc_library(
name = "py_access_service_proto",
deps = [":access_service_proto"],
visibility = ["//visibility:public"],
)
proto_library(
name = "pc_configuration_proto",
srcs = ["src/pc_emulator/proto/configuration.proto"],
deps = [],
)
cc_proto_library(
name = "pc_configuration_cc_proto",
deps = [":pc_configuration_proto"],
visibility = ["//visibility:public"],
)
proto_library(
name = "pc_system_specification_proto",
srcs = ["src/pc_emulator/proto/system_specification.proto",
"src/pc_emulator/proto/configuration.proto"],
deps = [],
)
cc_proto_library(
name = "pc_system_specification_cc_proto",
deps = [":pc_system_specification_proto"],
visibility = ["//visibility:public"],
)
cc_library(
name="pc_emulator_lib",
hdrs = glob([
"src/pc_emulator/include/**/*.h",
"src/pc_emulator/include/*.h",
"src/pc_emulator/ext_modules/include/*.h"
]),
srcs = glob([
"src/pc_emulator/core/**/*.cc",
"src/pc_emulator/core/*.cc",
"src/pc_emulator/ext_modules/*.cc"
]),
deps = ["@boost//:algorithm",
"@boost//:lexical_cast",
"@boost//:program_options",
"@boost//:exception",
"@kronoslib//:kronosapi",
":pc_system_specification_cc_proto"],
copts = ["-fpermissive -Wno-reorder -DDIR=\"$$PWD/\" -Wno-sign-compare -Wno-unused-variable"],
visibility = ["//visibility:public"],
alwayslink = True,
)
cc_library(
name="grpc_ext_lib",
hdrs = ["src/pc_emulator/grpc_ext/include/access_service_impl.h",
"src/pc_emulator/grpc_ext/include/ext_interface_grpc_api.h"],
srcs = [
"src/pc_emulator/grpc_ext/access_service_impl.cc",
"src/pc_emulator/grpc_ext/ext_interface_grpc_api.cc"],
deps = [
":pc_emulator_lib", ":access_service_proto_cpp",
"@boost//:filesystem"],
copts = ["-fpermissive -Wno-reorder -DDIR=\"$$PWD/\" -Wno-sign-compare"],
visibility = ["//visibility:public"],
alwayslink = True,
)
cc_binary(
name="pc_grpc_server",
srcs = ["src/pc_emulator/grpc_ext/grpc_server_main.cc"],
deps = [":grpc_ext_lib", ":access_service_proto_cpp"],
copts = ["-fpermissive -Wno-reorder -DDIR=\"$$PWD/\" -Wno-sign-compare"],
visibility = ["//visibility:public"],
linkstatic = 1,
)
cc_binary(
name="example_comm_module",
srcs = [
"examples/idle_plc/comm_module.cc"
],
deps = [":pc_emulator_lib"],
copts = ["-Iexternal/gtest/include -I/usr/local/include -fpermissive -Wno-reorder"],
linkstatic = 1,
)
cc_binary(
name="example_hmi",
srcs = [
"examples/common/example_hmi.cc"
],
deps = ["@boost//:algorithm", "@modbuslib//:modbusapi"],
copts = ["-Iexternal/gtest/include -I/usr/local/include -fpermissive -Wno-reorder"],
linkstatic = 1,
)
cc_binary(
name="modbus_comm_module",
srcs = [
"contrib/modbus_comm_module.cc"
],
deps = [":pc_emulator_lib", "@modbuslib//:modbusapi"],
copts = ["-Iexternal/gtest/include -I/usr/local/include -fpermissive -Wno-reorder -Wno-sign-compare -Wno-delete-non-virtual-dtor"],
linkstatic = 1,
)
cc_binary(
name="plc_runner",
srcs = [
"contrib/plc_runner.cc"
],
deps = [":pc_emulator_lib", "@kronoslib//:kronosapi"],
copts = ["-Iexternal/gtest/include -I/usr/local/include -fpermissive -Wno-reorder -Wno-switch -Wno-delete-non-virtual-dtor"],
linkstatic = 1,
)
cc_test(
name = "datatype_test",
srcs = ["src/pc_emulator/tests/datatype_tests/datatype_test.cc"],
copts = ["-Iexternal/gtest/include -fpermissive -Wno-reorder"],
deps = [":pc_emulator_lib",
"@gtest//:main"],
linkstatic = 1,
)
cc_test(
name = "variable_test",
srcs = ["src/pc_emulator/tests/variable_tests/variable_test.cc"],
copts = ["-Iexternal/gtest/include -fpermissive -Wno-reorder"],
deps = [":pc_emulator_lib",
"@gtest//:main"],
linkstatic = 1,
)
cc_test(
name = "execution_test",
srcs = ["src/pc_emulator/tests/execution_tests/execution_test.cc"],
copts = ["-Iexternal/gtest/include -fpermissive -Wno-reorder"],
deps = [":pc_emulator_lib",
"@gtest//:main"],
linkstatic = 1,
)
cc_test(
name = "insn_test",
srcs = ["src/pc_emulator/tests/insn_tests/insn_test.cc"],
copts = ["-Iexternal/gtest/include -fpermissive -Wno-reorder"],
deps = [":pc_emulator_lib",
"@gtest//:main"],
linkstatic = 1,
)
cc_test(
name = "access_test",
srcs = ["src/pc_emulator/tests/access_variable_tests/access_variable_test.cc"],
copts = ["-Iexternal/gtest/include -fpermissive -Wno-reorder"],
deps = [":pc_emulator_lib",
"@gtest//:main"],
linkstatic = 1,
)
cc_test(
name = "sfc_test",
srcs = ["src/pc_emulator/tests/sfc_tests/sfc_test.cc"],
copts = ["-Iexternal/gtest/include -fpermissive -Wno-reorder"],
deps = [":pc_emulator_lib",
"@gtest//:main"],
linkstatic = 1,
)