blob: c6961de0aadb7844abf6c2aba8900dc8d9c1b299 [file] [log] [blame]
Bob Badour370808d2021-02-12 14:17:41 -08001package {
2 default_applicable_licenses: ["external_android-clat_license"],
3}
4
5// Added automatically by a large-scale-change
6//
7// large-scale-change included anything that looked like it might be a license
8// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
9//
10// Please consider removing redundant or irrelevant files from 'license_text:'.
11// See: http://go/android-license-faq
12license {
13 name: "external_android-clat_license",
14 visibility: [":__subpackages__"],
15 license_kinds: [
16 "SPDX-license-identifier-Apache-2.0",
17 ],
18 license_text: [
19 "LICENSE",
20 "NOTICE",
21 ],
22}
23
Lorenzo Colittieb92f482019-01-04 14:59:11 +090024cc_defaults {
25 name: "clatd_defaults",
Dan Willemsen1e562182018-11-16 12:52:08 -080026
27 cflags: [
28 "-Wall",
29 "-Werror",
30 "-Wunused-parameter",
31
32 // Bug: http://b/33566695
33 "-Wno-address-of-packed-member",
34 ],
35
Lorenzo Colitti27da0ad2020-06-01 12:15:20 +090036 // For MARK_UNSET.
37 header_libs: [
38 "libnetd_client_headers"
39 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090040}
41
42// Code used both by the daemon and by unit tests.
43filegroup {
44 name: "clatd_common",
45 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090046 "clatd.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090047 "dump.c",
48 "getaddr.c",
49 "icmp.c",
50 "ipv4.c",
51 "ipv6.c",
52 "logging.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090053 "netlink_callbacks.c",
54 "netlink_msg.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090055 "setif.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090056 "translate.c",
57 ],
58}
59
60// The clat daemon.
61cc_binary {
62 name: "clatd",
63 defaults: ["clatd_defaults"],
64 srcs: [
65 ":clatd_common",
66 "main.c"
67 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080068 static_libs: ["libnl"],
69 shared_libs: [
70 "libcutils",
71 "liblog",
72 "libnetutils",
73 ],
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090074
75 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
76 // tests substantially increases build/compile cycle times and doesn't really provide a
77 // security benefit.
78 tidy: true,
79 tidy_checks: [
80 "-*",
81 "cert-*",
82 "clang-analyzer-security*",
83 "android-*",
84 ],
85 tidy_flags: [
86 "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
87 ],
Lorenzo Colitti92928722021-01-18 17:40:34 +090088 // Actually not required for clatd itself. See comments in the rc file.
89 init_rc: [
90 "vendor-464xlat.rc",
91 ],
Evgenii Stepanovafe05e12021-05-21 16:33:45 -070092 sanitize: {
93 memtag_heap: true,
94 },
Dan Willemsen1e562182018-11-16 12:52:08 -080095}
96
Dan Willemsen1e562182018-11-16 12:52:08 -080097// Unit tests.
98cc_test {
99 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900100 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -0800101 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900102 ":clatd_common",
103 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -0800104 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900105 static_libs: [
106 "libbase",
107 "libnetd_test_tun_interface",
108 "libnl",
109 ],
Dan Willemsen1e562182018-11-16 12:52:08 -0800110 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900111 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -0800112 "liblog",
113 "libnetutils",
114 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +0900115 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -0700116 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -0800117}