1libvsomeip_srcs = [
2    "implementation/endpoints/**/*.cpp",
3    "implementation/logging/**/*.cpp",
4    "implementation/tracing/**/*.cpp",
5    "implementation/message/**/*.cpp",
6    "implementation/routing/**/*.cpp",
7    "implementation/runtime/**/*.cpp",
8    "implementation/utility/**/*.cpp",
9    "implementation/plugin/**/*.cpp",
10    "implementation/security/**/*.cpp",
11    "implementation/logger/**/*.cpp",
12]
13
14libvsomeip_cfg_srcs = [
15    "implementation/configuration/src/*.cpp",
16]
17
18libvsomeip_e2e_srcs = [
19    "implementation/e2e_protection/src/*.cpp",
20]
21
22libvsomeip_sd_srcs = [
23    "implementation/service_discovery/src/*.cpp",
24]
25
26cc_defaults {
27    name: "vsomeip_defaults",
28
29    header_libs: [
30        "libboost_library_headers",
31    ],
32
33    local_include_dirs: [
34        "interface",
35        "implementation/helper/1.76",
36    ],
37
38    rtti: true,
39
40    host_supported: true,
41
42    cppflags: [
43        "-std=c++11",
44        "-fexceptions",
45        "-Wno-non-virtual-dtor",
46        "-Wno-unused-const-variable",
47        "-Wno-unused-parameter",
48        "-Wno-unused-private-field",
49        "-Wno-unused-lambda-capture",
50        "-Wno-unused-variable",
51        "-Wno-unused-local-typedef",
52        "-Wno-sign-compare",
53        "-Wno-format",
54        "-Wno-header-guard",
55        "-Wno-overloaded-virtual",
56        "-Wno-implicit-fallthrough",
57        "-Wno-macro-redefined",
58        "-Wno-enum-constexpr-conversion",
59    ],
60
61    target: {
62        linux_glibc: {
63            cppflags: [
64                // Soong is always adding -DANDROID even for the host
65                "-UANDROID",
66                "-DVSOMEIP_BASE_PATH=\"/tmp/\"",
67            ],
68            generated_headers: [
69                "vsomeip_gen_internal_hpp",
70            ],
71        },
72        android: {
73            cppflags: [
74                "-DVSOMEIP_BASE_PATH=\"/data/\"",
75            ],
76        },
77    },
78}
79
80// Adapted from CMakeLists.txt
81gensrcs {
82    name: "vsomeip_gen_internal_hpp",
83    srcs: [
84        "implementation/configuration/include/internal.hpp.in",
85    ],
86    cmd: "sed" +
87        " -e \"s|@DEFAULT_CONFIGURATION_FILE@|/etc/vsomeip.json|g\"" +
88        " -e \"s|@DEFAULT_CONFIGURATION_FOLDER@|/etc/vsomeip|g\"" +
89        " -e \"s|@VSOMEIP_MAJOR_VERSION@||g\"" +
90        " -e \"s|@VSOMEIP_DIAGNOSIS_ADDRESS@|0x01|g\"" +
91        " -e \"s|libvsomeip3-cfg\\.so\\.|libvsomeip3-cfg.so|g\"" +
92        " -e \"s|libvsomeip3-sd\\.so\\.|libvsomeip3-sd.so|g\"" +
93        " -e \"s|libvsomeip3-e2e\\.so\\.|libvsomeip3-e2e.so|g\"" +
94        " -e \"s|libvsomeip3-sec\\.so\\.|libvsomeip3-sec.so|g\"" +
95        " -e \"s|@VSOMEIP_UNICAST_ADDRESS@|127.0.0.1|g\"" +
96        " -e \"s|@VSOMEIP_ROUTING_READY_MESSAGE@|SOME/IP routing ready.|g\"" +
97        " $(in) > $(out) &&" +
98        " install $(out) external/sdv/vsomeip/implementation/configuration/include/internal.hpp",
99}
100
101cc_library_shared {
102    name: "libvsomeip3",
103    vendor: true,
104
105    srcs: libvsomeip_srcs,
106
107    defaults: [
108        "vsomeip_defaults",
109    ],
110
111    cflags: [
112        "-DWITHOUT_SYSTEMD",
113        "-Wno-enum-constexpr-conversion",
114    ],
115
116    rtti: true,
117
118    local_include_dirs: [
119        "interface",
120        "implementation/helper/1.76",
121    ],
122
123    export_include_dirs: [
124        "interface",
125    ],
126
127    static_libs: [
128        "libboost_system",
129        "libboost_thread",
130        "libboost_filesystem",
131    ],
132
133    shared_libs: [
134        "liblog",
135        "libutils",
136    ],
137}
138
139cc_library_shared {
140    name: "libvsomeip3-cfg",
141    vendor: true,
142
143    srcs: libvsomeip_cfg_srcs,
144
145    defaults: [
146        "vsomeip_defaults",
147    ],
148
149    rtti: true,
150
151    local_include_dirs: [
152        "interface",
153        "implementation/helper/1.76",
154    ],
155
156    shared_libs: [
157        "libvsomeip3",
158        "libboost_system",
159        "libboost_filesystem",
160    ],
161}
162
163cc_library_shared {
164    name: "libvsomeip3-e2e",
165    vendor: true,
166
167    srcs: libvsomeip_e2e_srcs,
168
169    defaults: [
170        "vsomeip_defaults",
171    ],
172
173    rtti: true,
174
175    local_include_dirs: [
176        "interface",
177        "implementation/helper/1.76",
178    ],
179
180    shared_libs: [
181        "libvsomeip3",
182        "liblog",
183    ],
184}
185
186cc_library_shared {
187    name: "libvsomeip3-sd",
188    vendor: true,
189
190    srcs: libvsomeip_sd_srcs,
191
192    defaults: [
193        "vsomeip_defaults",
194    ],
195
196    rtti: true,
197
198    local_include_dirs: [
199        "interface",
200        "implementation/helper/1.76",
201    ],
202
203    shared_libs: [
204        "libvsomeip3",
205        "liblog",
206        "libboost_thread",
207    ],
208}
209
210cc_defaults {
211    name: "vsomeip_example_defaults",
212    vendor: true,
213    owner: "ts",
214    host_supported: true,
215    shared_libs: [
216        "libvsomeip3",
217        "liblog",
218    ],
219}
220
221cc_binary {
222    name: "vsomeip-helloworld-client",
223    defaults: ["vsomeip_example_defaults"],
224
225    srcs: [
226        "examples/hello_world/hello_world_client_main.cpp",
227    ],
228}
229
230cc_binary {
231    name: "vsomeip-helloworld-service",
232    defaults: ["vsomeip_example_defaults"],
233
234    srcs: [
235        "examples/hello_world/hello_world_service_main.cpp",
236    ],
237}
238
239cc_binary {
240    name: "vsomeip-notify-sample",
241    defaults: ["vsomeip_example_defaults"],
242
243    srcs: [
244        "examples/notify-sample.cpp",
245    ],
246}
247
248cc_binary {
249    name: "vsomeip-request-sample",
250    defaults: ["vsomeip_example_defaults"],
251
252    srcs: [
253        "examples/request-sample.cpp",
254    ],
255}
256
257cc_binary {
258    name: "vsomeip-response-sample",
259    defaults: ["vsomeip_example_defaults"],
260
261    srcs: [
262        "examples/response-sample.cpp",
263    ],
264}
265
266cc_binary {
267    name: "vsomeip-subscribe-sample",
268    defaults: ["vsomeip_example_defaults"],
269
270    srcs: [
271        "examples/subscribe-sample.cpp",
272    ],
273}
274