1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    default_applicable_licenses: ["system_chre_license"],
19}
20
21// Added automatically by a large-scale-change that took the approach of
22// 'apply every license found to every target'. While this makes sure we respect
23// every license restriction, it may not be entirely correct.
24//
25// e.g. GPL in an MIT project might only apply to the contrib/ directory.
26//
27// Please consider splitting the single license below into multiple licenses,
28// taking care not to lose any license_kind information, and overriding the
29// default license using the 'licenses: [...]' property on targets as needed.
30//
31// For unused files, consider creating a 'fileGroup' with "//visibility:private"
32// to attach the license to, and including a comment whether the files may be
33// used in the current project.
34// See: http://go/android-license-faq
35license {
36    name: "system_chre_license",
37    visibility: [":__subpackages__"],
38    license_kinds: [
39        "SPDX-license-identifier-Apache-2.0",
40        "SPDX-license-identifier-BSD",
41    ],
42    license_text: [
43        "NOTICE",
44    ],
45}
46
47cc_library_static {
48    name: "chre_client",
49    vendor: true,
50    export_include_dirs: [
51        "host/common/include",
52        "platform/shared/include",
53        "util/include",
54    ],
55    srcs: [
56        "host/common/fragmented_load_transaction.cc",
57        "host/common/host_protocol_host.cc",
58        "host/common/socket_client.cc",
59        "platform/shared/host_protocol_common.cc",
60    ],
61    header_libs: ["chre_flatbuffers"],
62    export_header_lib_headers: ["chre_flatbuffers"],
63    shared_libs: [
64        "libcutils",
65        "liblog",
66        "libutils",
67    ],
68    cflags: ["-Wall", "-Werror"],
69}
70
71cc_binary {
72    name: "chre_test_client",
73    vendor: true,
74    local_include_dirs: [
75        "chre_api/include/chre_api",
76        "util/include",
77    ],
78    srcs: [
79        "host/common/test/chre_test_client.cc",
80    ],
81    cflags: ["-Wall", "-Werror"],
82    shared_libs: [
83        "libcutils",
84        "liblog",
85        "libutils",
86    ],
87    static_libs: ["chre_client"],
88}
89
90cc_binary {
91    name: "chre_power_test_client",
92    vendor: true,
93    local_include_dirs: [
94        "chre_api/include/chre_api",
95        "util/include",
96        "apps/power_test/common/include",
97    ],
98    srcs: [
99        "host/common/test/power_test/chre_power_test_client.cc",
100    ],
101    cflags: ["-Wall", "-Werror"],
102    shared_libs: [
103        "libcutils",
104        "liblog",
105        "libutils",
106    ],
107    static_libs: ["chre_client"],
108}
109
110cc_test {
111    name: "audio_stress_test",
112    vendor: true,
113    local_include_dirs: [
114        "chre_api/include/chre_api",
115        "util/include",
116    ],
117    srcs: [
118        "host/common/audio_stress_test/audio_stress_test.cc",
119    ],
120    cflags: ["-Wall", "-Werror"],
121    shared_libs: [
122        "libcutils",
123        "liblog",
124        "libutils",
125    ],
126    static_libs: ["chre_client"],
127    gtest: false,
128}
129
130cc_library_headers {
131    name: "android.hardware.contexthub@1.X-shared-impl",
132    vendor: true,
133    export_include_dirs: ["host/hal_generic/common/"],
134    cflags: ["-Wall", "-Werror"],
135    shared_libs: [
136        "libcutils",
137        "liblog",
138        "libhidlbase",
139        "libutils",
140        "android.hardware.contexthub@1.0",
141    ],
142    static_libs: ["chre_client"],
143}
144
145cc_library_shared {
146    name: "android.hardware.contexthub@1.0-impl.generic",
147    vendor: true,
148    relative_install_path: "hw",
149    srcs: [
150        "host/hal_generic/V1_0/generic_context_hub_v1_0.cc",
151        "host/hal_generic/common/permissions_util.cc",
152    ],
153    cflags: ["-Wall", "-Werror"],
154    header_libs: [
155        "android.hardware.contexthub@1.X-shared-impl",
156        "android.hardware.contexthub@1.X-common-utils",
157    ],
158    shared_libs: [
159        "libcutils",
160        "liblog",
161        "libhidlbase",
162        "libutils",
163        "android.hardware.contexthub@1.0",
164        "android.hardware.contexthub@1.1",
165        "android.hardware.contexthub@1.2",
166    ],
167    static_libs: ["chre_client"],
168}
169
170cc_binary {
171    name: "android.hardware.contexthub@1.1-service.generic",
172    defaults: ["hidl_defaults"],
173    vendor: true,
174    relative_install_path: "hw",
175    srcs: [
176        "host/hal_generic/V1_1/generic_context_hub_v1_1.cc",
177        "host/hal_generic/V1_1/service.cc",
178        "host/hal_generic/common/context_hub_settings_util.cc",
179        "host/hal_generic/common/permissions_util.cc",
180    ],
181    init_rc: ["host/hal_generic/V1_1/android.hardware.contexthub@1.1-service-generic.rc"],
182    cflags: ["-Wall", "-Werror"],
183    header_libs: [
184        "android.hardware.contexthub@1.X-shared-impl",
185        "android.hardware.contexthub@1.X-common-utils",
186    ],
187    shared_libs: [
188        "libcutils",
189        "liblog",
190        "libhidlbase",
191        "libutils",
192        "android.hardware.contexthub@1.0",
193        "android.hardware.contexthub@1.1",
194        "android.hardware.contexthub@1.2",
195    ],
196    static_libs: ["chre_client"],
197    vintf_fragments: ["host/hal_generic/V1_1/android.hardware.contexthub@1.1-generic.xml"],
198}
199
200cc_binary {
201    name: "android.hardware.contexthub@1.2-service.generic",
202    defaults: ["hidl_defaults"],
203    vendor: true,
204    relative_install_path: "hw",
205    srcs: [
206        "host/hal_generic/V1_2/generic_context_hub_v1_2.cc",
207        "host/hal_generic/V1_2/service.cc",
208        "host/hal_generic/common/context_hub_settings_util.cc",
209        "host/hal_generic/common/permissions_util.cc",
210    ],
211    init_rc: ["host/hal_generic/V1_2/android.hardware.contexthub@1.2-service-generic.rc"],
212    cflags: ["-Wall", "-Werror"],
213    header_libs: [
214        "android.hardware.contexthub@1.X-shared-impl",
215        "android.hardware.contexthub@1.X-common-utils",
216    ],
217    shared_libs: [
218        "libcutils",
219        "liblog",
220        "libhidlbase",
221        "libutils",
222        "android.hardware.contexthub@1.0",
223        "android.hardware.contexthub@1.1",
224        "android.hardware.contexthub@1.2",
225    ],
226    static_libs: ["chre_client"],
227    vintf_fragments: ["host/hal_generic/V1_2/android.hardware.contexthub@1.2-generic.xml"],
228}
229
230cc_library_headers {
231    name: "chre_api",
232    vendor: true,
233    export_include_dirs: [
234        "chre_api/include/chre_api",
235        "chre_api/include",
236    ],
237    host_supported: true,
238}
239
240cc_library_headers {
241    name: "chre_flatbuffers",
242    vendor: true,
243    export_include_dirs: [
244        "external/flatbuffers/include",
245    ],
246}
247
248cc_library_headers {
249    name: "chre_pal",
250    vendor: true,
251    export_include_dirs: [
252        "pal/include",
253    ],
254    header_libs: [
255        "chre_api",
256    ],
257    export_header_lib_headers: [
258        "chre_api",
259    ],
260    host_supported: true,
261}
262
263cc_library_headers {
264    name: "chre_test_common",
265    vendor: true,
266    export_include_dirs: [
267        "test/common/include",
268    ],
269    host_supported: true,
270}
271
272cc_library_static {
273    name: "chre_pal_linux",
274    vendor: true,
275    srcs: [
276        "platform/shared/pal_system_api.cc",
277        "platform/linux/assert.cc",
278        "platform/linux/fatal_error.cc",
279        "platform/linux/memory.cc",
280        "platform/linux/pal_gnss.cc",
281        "platform/linux/pal_wifi.cc",
282        "platform/linux/pal_wwan.cc",
283        "platform/linux/platform_log.cc",
284        "platform/linux/system_time.cc",
285    ],
286    export_include_dirs: [
287        "platform/shared/include",
288        "platform/include",
289        "platform/linux/include",
290        "util/include",
291    ],
292    header_libs: [
293        "chre_pal",
294    ],
295    cflags: [
296        "-DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG",
297        "-DCHRE_ASSERTIONS_ENABLED=true",
298        "-DCHRE_FILENAME=__FILE__"
299    ],
300    host_supported: true,
301}
302
303cc_test_host {
304    name: "chre_unit_tests",
305    srcs: [
306        "core/event_ref_queue.cc",
307        "core/nanoapp.cc",
308        "core/sensor_request.cc",
309        "core/tests/**/*.cc",
310        "core/wifi_scan_request.cc",
311        "pal/tests/src/wwan_test.cc",
312        "pal/tests/src/version_test.cc",
313        "pal/util/tests/**/*.cc",
314        "pal/util/wifi_scan_cache.c",
315        "platform/linux/assert.cc",
316        "platform/linux/fatal_error.cc",
317        "platform/linux/platform_nanoapp.cc",
318        "platform/linux/platform_log.cc",
319        "platform/linux/memory.cc",
320        "platform/linux/memory_manager.cc",
321        "platform/linux/system_time.cc",
322        "platform/shared/log_buffer.cc",
323        "platform/shared/memory_manager.cc",
324        "platform/shared/pal_system_api.cc",
325        "platform/tests/**/*.cc",
326        "util/buffer_base.cc",
327        "util/dynamic_vector_base.cc",
328        "util/nanoapp/wifi.cc",
329        "util/system/debug_dump.cc",
330        "util/tests/**/*.cc",
331    ],
332    local_include_dirs: [
333        "chre_api/include",
334        "chre_api/include/chre_api",
335        "core/include",
336        "pal/include",
337        "pal/util/include",
338        "platform/linux/include",
339        "platform/shared/include",
340        "platform/include",
341        "util/include",
342    ],
343    test_suites: [
344        // Needed to support running on TreeHugger
345        "general-tests",
346    ],
347    cflags: [
348        "-DCHRE_MESSAGE_TO_HOST_MAX_SIZE=4096",
349        "-DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG",
350        "-DCHRE_ASSERTIONS_ENABLED=true",
351        "-DCHRE_FILENAME=__FILE__",
352        "-DGTEST",
353    ],
354    static_libs: [
355        "libgmock",
356    ],
357}
358
359subdirs = [
360    "apps/wifi_offload",
361]
362