|  | /* | 
|  | * Copyright (C) 2019 The Android Open Source Project | 
|  | * | 
|  | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | * you may not use this file except in compliance with the License. | 
|  | * You may obtain a copy of the License at | 
|  | * | 
|  | *      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | * | 
|  | * Unless required by applicable law or agreed to in writing, software | 
|  | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | * See the License for the specific language governing permissions and | 
|  | * limitations under the License. | 
|  | */ | 
|  |  | 
|  |  | 
|  | package { | 
|  | // See: http://go/android-license-faq | 
|  | // A large-scale-change added 'default_applicable_licenses' to import | 
|  | // all of the 'license_kinds' from "system_chre_license" | 
|  | // to get the below license kinds: | 
|  | //   SPDX-license-identifier-Apache-2.0 | 
|  | default_applicable_licenses: ["system_chre_license"], | 
|  | } | 
|  |  | 
|  | cc_library_static { | 
|  | name: "chre_chpp_linux", | 
|  | vendor: true, | 
|  | cflags: [ | 
|  | "-std=c89", | 
|  | "-Wall", | 
|  | "-Wcast-align", | 
|  | "-Wcast-qual", | 
|  | "-Wconversion", | 
|  | "-Werror", | 
|  | "-Wextra", | 
|  | "-Wmissing-prototypes", | 
|  | "-Wno-strict-aliasing", | 
|  | "-Wpointer-arith", | 
|  | "-Wsign-compare", | 
|  | "-Wshadow", | 
|  | "-Wstrict-prototypes", | 
|  | "-Wswitch", | 
|  | "-DCHPP_CLIENT_ENABLED_DISCOVERY", | 
|  | "-DCHPP_CLIENT_ENABLED_LOOPBACK", | 
|  | "-DCHPP_CLIENT_ENABLED_TIMESYNC", | 
|  | "-DCHPP_CLIENT_ENABLED_TRANSPORT_LOOPBACK", | 
|  | "-DCHPP_CLIENT_ENABLED_GNSS", | 
|  | "-DCHPP_CLIENT_ENABLED_WIFI", | 
|  | "-DCHPP_CLIENT_ENABLED_WWAN", | 
|  | "-DCHPP_SERVICE_ENABLED_GNSS", | 
|  | "-DCHPP_SERVICE_ENABLED_WIFI", | 
|  | "-DCHPP_SERVICE_ENABLED_WWAN", | 
|  | "-DCHPP_SERVICE_ENABLED_TRANSPORT_LOOPBACK", | 
|  | "-DCHPP_MAX_REGISTERED_CLIENTS=3", | 
|  | "-DCHPP_MAX_REGISTERED_SERVICES=3", | 
|  | "-DCHPP_ENABLE_WORK_MONITOR", | 
|  | "-DCHPP_DEBUG_ASSERT_ENABLED", | 
|  | "-DCHPP_WIFI_DEFAULT_CAPABILITIES=0xf", | 
|  | "-DCHPP_WWAN_DEFAULT_CAPABILITIES=0x1", | 
|  | "-DCHPP_GNSS_DEFAULT_CAPABILITIES=0x7", | 
|  | // clock_gettime() requires _POSIX_C_SOURCE >= 199309L | 
|  | "-D_POSIX_C_SOURCE=199309L", | 
|  | // Required for pthread_setname_np() | 
|  | "-D_GNU_SOURCE", | 
|  | ], | 
|  | conlyflags: ["-std=c11"], | 
|  | srcs: [ | 
|  | "transport.c", | 
|  | "app.c", | 
|  | "clients.c", | 
|  | "services.c", | 
|  | "clients/discovery.c", | 
|  | "clients/loopback.c", | 
|  | "clients/timesync.c", | 
|  | "clients/gnss.c", | 
|  | "clients/wifi.c", | 
|  | "clients/wwan.c", | 
|  | "common/gnss_convert.c", | 
|  | "common/wifi_convert.c", | 
|  | "common/wifi_utils.c", | 
|  | "common/wwan_convert.c", | 
|  | "services/discovery.c", | 
|  | "services/loopback.c", | 
|  | "services/nonhandle.c", | 
|  | "services/timesync.c", | 
|  | "services/gnss.c", | 
|  | "services/wifi.c", | 
|  | "services/wwan.c", | 
|  | "platform/pal_api.c", | 
|  | "platform/linux/link.c", | 
|  | "platform/linux/memory.c", | 
|  | "platform/linux/notifier.c", | 
|  | "platform/shared/crc.c", | 
|  | "platform/linux/services/platform_gnss.c", | 
|  | ], | 
|  | export_include_dirs: [ | 
|  | "platform/linux/include", | 
|  | "include", | 
|  | ], | 
|  | header_libs: [ | 
|  | "chre_pal", | 
|  | "chre_api", | 
|  | ], | 
|  | export_header_lib_headers: [ | 
|  | "chre_pal", | 
|  | "chre_api", | 
|  | ], | 
|  | static_libs: ["chre_pal_linux"], | 
|  | host_supported: true, | 
|  | } | 
|  |  | 
|  | cc_test_host { | 
|  | name: "chre_chpp_linux_tests", | 
|  | cflags: [ | 
|  | "-DCHPP_CLIENT_ENABLED_TRANSPORT_LOOPBACK", | 
|  | "-DCHPP_CHECKSUM_ENABLED", | 
|  | "-DCHPP_MAX_REGISTERED_CLIENTS=3", | 
|  | "-DCHPP_MAX_REGISTERED_SERVICES=3", | 
|  | "-DCHPP_WIFI_DEFAULT_CAPABILITIES=0xf", | 
|  | "-DCHPP_WWAN_DEFAULT_CAPABILITIES=0x1", | 
|  | "-DCHPP_GNSS_DEFAULT_CAPABILITIES=0x7", | 
|  | "-DCHPP_ENABLE_WORK_MONITOR", | 
|  | ], | 
|  | srcs: [ | 
|  | "test/app_test_base.cpp", | 
|  | "test/app_test.cpp", | 
|  | "test/gnss_test.cpp", | 
|  | "test/transport_test.cpp", | 
|  | "test/clients_test.cpp", | 
|  | ], | 
|  | static_libs: [ | 
|  | "chre_chpp_linux", | 
|  | "chre_pal_linux", | 
|  | ], | 
|  | sanitize: { | 
|  | address: true, | 
|  | } | 
|  | } | 
|  |  | 
|  | cc_test_host { | 
|  | name: "chre_chpp_convert_tests", | 
|  | cflags: [ | 
|  | "-Wcast-align", | 
|  | "-Wsign-compare", | 
|  | ], | 
|  | header_libs: [ | 
|  | "chre_test_common", | 
|  | ], | 
|  | srcs: [ | 
|  | "test/wifi_convert_test.cpp", | 
|  | "test/wwan_convert_test.cpp" | 
|  | ], | 
|  | static_libs: ["chre_chpp_linux"], | 
|  | } |