blob: b072668e21a8e001244b5a2e0ab70452580e418d [file] [log] [blame]
Robin Lee4fd4d392017-03-14 14:03:05 +00001// Copyright (C) 2017 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badour4114d1a2021-02-12 15:38:42 -080015package {
Aditya Choudharyf7e2afb2024-01-30 13:47:16 +000016 default_team: "trendy_team_fwk_core_networking",
Bob Badour4114d1a2021-02-12 15:38:42 -080017 // See: http://go/android-license-faq
18 // A large-scale-change added 'default_applicable_licenses' to import
19 // all of the 'license_kinds' from "system_netd_license"
20 // to get the below license kinds:
21 // SPDX-license-identifier-Apache-2.0
22 default_applicable_licenses: ["system_netd_license"],
23}
24
Maciej Żenczykowski83d22ac2023-08-30 11:51:51 +000025cc_defaults {
26 name: "libnetd_client_defaults",
Robin Lee4fd4d392017-03-14 14:03:05 +000027 srcs: [
28 "FwmarkClient.cpp",
29 "NetdClient.cpp",
30 ],
Luke Huangc68f1b92018-11-21 20:13:38 +080031 header_libs: [
Luke Huang743e0312020-05-26 17:21:28 +080032 "dnsproxyd_protocol_headers", // NETID_USE_LOCAL_NAMESERVERS
Luke Huangc68f1b92018-11-21 20:13:38 +080033 "libnetd_client_headers",
Luke Huange48fbcb2018-12-17 16:37:33 +080034 "libbase_headers", // for unique_fd.h
Motomu Utsumi2ef5f2d2023-08-22 12:55:37 +090035 "libnetd_utils_headers",
Luke Huangc68f1b92018-11-21 20:13:38 +080036 ],
Robin Lee4fd4d392017-03-14 14:03:05 +000037 export_header_lib_headers: ["libnetd_client_headers"],
Erik Klineab999f12018-07-04 11:29:31 +090038 defaults: ["netd_defaults"],
Ken Chen2e413c32020-01-13 11:59:53 +080039 sanitize: {
40 cfi: true,
Ken Chen2e413c32020-01-13 11:59:53 +080041 },
Maciej Żenczykowski83d22ac2023-08-30 11:51:51 +000042}
43
44cc_library_shared {
45 name: "libnetd_client",
46 defaults: ["libnetd_client_defaults"],
Remi NGUYEN VAN4bcb81c2020-11-27 19:04:14 +090047 apex_available: [
48 "//apex_available:platform",
Remi NGUYEN VAN4bcb81c2020-11-27 19:04:14 +090049 ],
Robin Lee4fd4d392017-03-14 14:03:05 +000050}
Luke Huang63df9482019-05-25 18:24:03 +080051
Maciej Żenczykowski83d22ac2023-08-30 11:51:51 +000052cc_library_static {
Maciej Żenczykowski1430a5f2023-08-30 10:22:08 +000053 name: "libnetd_client_static_for_test",
Maciej Żenczykowski83d22ac2023-08-30 11:51:51 +000054 defaults: ["libnetd_client_defaults"],
Maciej Żenczykowski1430a5f2023-08-30 10:22:08 +000055 visibility: ["//visibility:private"],
56}
57
Luke Huang63df9482019-05-25 18:24:03 +080058cc_test {
59 name: "netdclient_test",
60 srcs: [
61 "NetdClientTest.cpp",
62 ],
63 defaults: ["netd_defaults"],
64 test_suites: ["device-tests"],
65 include_dirs: [
Luke Huang63df9482019-05-25 18:24:03 +080066 "system/netd/include",
chenbrucea7d6b812019-06-28 16:37:36 +080067 ],
Luke Huang63df9482019-05-25 18:24:03 +080068 static_libs: [
69 "libgmock",
70 "libbase",
Maciej Żenczykowski1430a5f2023-08-30 10:22:08 +000071 "libnetd_client_static_for_test",
Luke Huang63df9482019-05-25 18:24:03 +080072 ],
73 sanitize: {
Maciej Żenczykowski85a0e3e2021-01-15 23:00:47 -080074 address: false,
Aditya Choudharyf7e2afb2024-01-30 13:47:16 +000075 recover: ["all"],
Luke Huang63df9482019-05-25 18:24:03 +080076 },
77}
Ken Chen1a028a72022-10-27 17:54:38 +080078
79cc_test {
80 name: "netdclient_root_test",
Aditya Choudharyf7e2afb2024-01-30 13:47:16 +000081 require_root: true, // for ScopedUidChange
Ken Chen1a028a72022-10-27 17:54:38 +080082 srcs: [
83 "NetdClientRootTest.cpp",
84 ],
85 defaults: [
86 "netd_aidl_interface_lateststable_cpp_static",
87 "netd_defaults",
88 ],
89 test_suites: ["device-tests"],
90 include_dirs: [
91 "system/netd/include",
92 ],
93 static_libs: [
94 "libbase",
Maciej Żenczykowski1430a5f2023-08-30 10:22:08 +000095 "libnetd_client_static_for_test",
Ken Chen1a028a72022-10-27 17:54:38 +080096 "libnetd_test_utils",
97 ],
98 sanitize: {
99 address: false,
Aditya Choudharyf7e2afb2024-01-30 13:47:16 +0000100 recover: ["all"],
Ken Chen1a028a72022-10-27 17:54:38 +0800101 },
102}