xref: /aosp_15_r20/system/netd/client/Android.bp (revision 8542734a0dd1db395a4d42aae09c37f3c3c3e7a1)
1// 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
15package {
16    default_team: "trendy_team_fwk_core_networking",
17    // 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
25cc_defaults {
26    name: "libnetd_client_defaults",
27    srcs: [
28        "FwmarkClient.cpp",
29        "NetdClient.cpp",
30    ],
31    header_libs: [
32        "dnsproxyd_protocol_headers", // NETID_USE_LOCAL_NAMESERVERS
33        "libnetd_client_headers",
34        "libbase_headers", // for unique_fd.h
35        "libnetd_utils_headers",
36    ],
37    export_header_lib_headers: ["libnetd_client_headers"],
38    defaults: ["netd_defaults"],
39    sanitize: {
40        cfi: true,
41    },
42}
43
44cc_library_shared {
45    name: "libnetd_client",
46    defaults: ["libnetd_client_defaults"],
47    apex_available: [
48        "//apex_available:platform",
49    ],
50}
51
52cc_library_static {
53    name: "libnetd_client_static_for_test",
54    defaults: ["libnetd_client_defaults"],
55    visibility: ["//visibility:private"],
56}
57
58cc_test {
59    name: "netdclient_test",
60    srcs: [
61        "NetdClientTest.cpp",
62    ],
63    defaults: ["netd_defaults"],
64    test_suites: ["device-tests"],
65    include_dirs: [
66        "system/netd/include",
67    ],
68    static_libs: [
69        "libgmock",
70        "libbase",
71        "libnetd_client_static_for_test",
72    ],
73    sanitize: {
74        address: false,
75        recover: ["all"],
76    },
77}
78
79cc_test {
80    name: "netdclient_root_test",
81    require_root: true, // for ScopedUidChange
82    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",
95        "libnetd_client_static_for_test",
96        "libnetd_test_utils",
97    ],
98    sanitize: {
99        address: false,
100        recover: ["all"],
101    },
102}
103