1/* 2 * Copyright (C) 2019 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 17 18package { 19 // See: http://go/android-license-faq 20 // A large-scale-change added 'default_applicable_licenses' to import 21 // all of the 'license_kinds' from "system_chre_license" 22 // to get the below license kinds: 23 // SPDX-license-identifier-Apache-2.0 24 default_applicable_licenses: ["system_chre_license"], 25} 26 27cc_library_static { 28 name: "chre_chpp_linux", 29 vendor: true, 30 cflags: [ 31 "-std=c89", 32 "-Wall", 33 "-Wcast-align", 34 "-Wcast-qual", 35 "-Wconversion", 36 "-Werror", 37 "-Wextra", 38 "-Wmissing-prototypes", 39 "-Wno-strict-aliasing", 40 "-Wpointer-arith", 41 "-Wsign-compare", 42 "-Wshadow", 43 "-Wstrict-prototypes", 44 "-Wswitch", 45 "-DCHPP_CLIENT_ENABLED_DISCOVERY", 46 "-DCHPP_CLIENT_ENABLED_LOOPBACK", 47 "-DCHPP_CLIENT_ENABLED_TIMESYNC", 48 "-DCHPP_CLIENT_ENABLED_TRANSPORT_LOOPBACK", 49 "-DCHPP_CLIENT_ENABLED_GNSS", 50 "-DCHPP_CLIENT_ENABLED_WIFI", 51 "-DCHPP_CLIENT_ENABLED_WWAN", 52 "-DCHPP_SERVICE_ENABLED_GNSS", 53 "-DCHPP_SERVICE_ENABLED_WIFI", 54 "-DCHPP_SERVICE_ENABLED_WWAN", 55 "-DCHPP_SERVICE_ENABLED_TRANSPORT_LOOPBACK", 56 "-DCHPP_MAX_REGISTERED_CLIENTS=3", 57 "-DCHPP_MAX_REGISTERED_SERVICES=3", 58 "-DCHPP_ENABLE_WORK_MONITOR", 59 "-DCHPP_DEBUG_ASSERT_ENABLED", 60 "-DCHPP_WIFI_DEFAULT_CAPABILITIES=0xf", 61 "-DCHPP_WWAN_DEFAULT_CAPABILITIES=0x1", 62 "-DCHPP_GNSS_DEFAULT_CAPABILITIES=0x7", 63 // clock_gettime() requires _POSIX_C_SOURCE >= 199309L 64 "-D_POSIX_C_SOURCE=199309L", 65 // Required for pthread_setname_np() 66 "-D_GNU_SOURCE", 67 ], 68 conlyflags: ["-std=c11"], 69 srcs: [ 70 "transport.c", 71 "app.c", 72 "clients.c", 73 "services.c", 74 "clients/discovery.c", 75 "clients/loopback.c", 76 "clients/timesync.c", 77 "clients/gnss.c", 78 "clients/wifi.c", 79 "clients/wwan.c", 80 "common/gnss_convert.c", 81 "common/wifi_convert.c", 82 "common/wifi_utils.c", 83 "common/wwan_convert.c", 84 "services/discovery.c", 85 "services/loopback.c", 86 "services/nonhandle.c", 87 "services/timesync.c", 88 "services/gnss.c", 89 "services/wifi.c", 90 "services/wwan.c", 91 "platform/pal_api.c", 92 "platform/linux/link.c", 93 "platform/linux/memory.c", 94 "platform/linux/notifier.c", 95 "platform/shared/crc.c", 96 "platform/linux/services/platform_gnss.c", 97 ], 98 export_include_dirs: [ 99 "platform/linux/include", 100 "include", 101 ], 102 header_libs: [ 103 "chre_pal", 104 "chre_api", 105 ], 106 export_header_lib_headers: [ 107 "chre_pal", 108 "chre_api", 109 ], 110 static_libs: ["chre_pal_linux"], 111 host_supported: true, 112} 113 114cc_test_host { 115 name: "chre_chpp_linux_tests", 116 cflags: [ 117 "-DCHPP_CLIENT_ENABLED_TRANSPORT_LOOPBACK", 118 "-DCHPP_CHECKSUM_ENABLED", 119 "-DCHPP_MAX_REGISTERED_CLIENTS=3", 120 "-DCHPP_MAX_REGISTERED_SERVICES=3", 121 "-DCHPP_WIFI_DEFAULT_CAPABILITIES=0xf", 122 "-DCHPP_WWAN_DEFAULT_CAPABILITIES=0x1", 123 "-DCHPP_GNSS_DEFAULT_CAPABILITIES=0x7", 124 "-DCHPP_ENABLE_WORK_MONITOR", 125 ], 126 srcs: [ 127 "test/app_test_base.cpp", 128 "test/app_test.cpp", 129 "test/gnss_test.cpp", 130 "test/transport_test.cpp", 131 "test/clients_test.cpp", 132 ], 133 static_libs: [ 134 "chre_chpp_linux", 135 "chre_pal_linux", 136 ], 137 sanitize: { 138 address: true, 139 } 140} 141 142cc_test_host { 143 name: "chre_chpp_convert_tests", 144 cflags: [ 145 "-Wcast-align", 146 "-Wsign-compare", 147 ], 148 header_libs: [ 149 "chre_test_common", 150 ], 151 srcs: [ 152 "test/wifi_convert_test.cpp", 153 "test/wwan_convert_test.cpp" 154 ], 155 static_libs: ["chre_chpp_linux"], 156} 157