blob: adc36e7b1ee8b8842523eeb52f3432a88d1bc6f7 [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",
55 "ring.c",
56 "setif.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090057 "translate.c",
58 ],
59}
60
61// The clat daemon.
62cc_binary {
63 name: "clatd",
64 defaults: ["clatd_defaults"],
65 srcs: [
66 ":clatd_common",
67 "main.c"
68 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080069 static_libs: ["libnl"],
70 shared_libs: [
71 "libcutils",
72 "liblog",
73 "libnetutils",
74 ],
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090075
76 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
77 // tests substantially increases build/compile cycle times and doesn't really provide a
78 // security benefit.
79 tidy: true,
80 tidy_checks: [
81 "-*",
82 "cert-*",
83 "clang-analyzer-security*",
84 "android-*",
85 ],
86 tidy_flags: [
87 "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
88 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080089}
90
Dan Willemsen1e562182018-11-16 12:52:08 -080091// Unit tests.
92cc_test {
93 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090094 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080095 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090096 ":clatd_common",
97 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080098 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090099 static_libs: [
100 "libbase",
101 "libnetd_test_tun_interface",
102 "libnl",
103 ],
Dan Willemsen1e562182018-11-16 12:52:08 -0800104 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900105 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -0800106 "liblog",
107 "libnetutils",
108 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +0900109 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -0700110 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -0800111}