blob: bff97d3338487c51ab3f2d267c3c6d4dd988fa0d [file] [log] [blame]
Lorenzo Colittieb92f482019-01-04 14:59:11 +09001cc_defaults {
2 name: "clatd_defaults",
Dan Willemsen1e562182018-11-16 12:52:08 -08003
4 cflags: [
5 "-Wall",
6 "-Werror",
7 "-Wunused-parameter",
8
9 // Bug: http://b/33566695
10 "-Wno-address-of-packed-member",
11 ],
12
Lorenzo Colitti27da0ad2020-06-01 12:15:20 +090013 // For MARK_UNSET.
14 header_libs: [
15 "libnetd_client_headers"
16 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090017}
18
19// Code used both by the daemon and by unit tests.
20filegroup {
21 name: "clatd_common",
22 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090023 "config.c",
24 "clatd.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090025 "dump.c",
26 "getaddr.c",
27 "icmp.c",
28 "ipv4.c",
29 "ipv6.c",
30 "logging.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090031 "netlink_callbacks.c",
32 "netlink_msg.c",
33 "ring.c",
34 "setif.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090035 "translate.c",
36 ],
37}
38
39// The clat daemon.
40cc_binary {
41 name: "clatd",
42 defaults: ["clatd_defaults"],
43 srcs: [
44 ":clatd_common",
45 "main.c"
46 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080047 static_libs: ["libnl"],
48 shared_libs: [
49 "libcutils",
50 "liblog",
51 "libnetutils",
52 ],
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090053
54 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
55 // tests substantially increases build/compile cycle times and doesn't really provide a
56 // security benefit.
57 tidy: true,
58 tidy_checks: [
59 "-*",
60 "cert-*",
61 "clang-analyzer-security*",
62 "android-*",
63 ],
64 tidy_flags: [
65 "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
66 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080067}
68
69// The configuration file.
70prebuilt_etc {
71 name: "clatd.conf",
72 src: "clatd.conf",
73}
74
75// Unit tests.
76cc_test {
77 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090078 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080079 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090080 ":clatd_common",
81 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080082 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090083 static_libs: [
84 "libbase",
85 "libnetd_test_tun_interface",
86 "libnl",
87 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080088 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090089 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -080090 "liblog",
91 "libnetutils",
92 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +090093 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -070094 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -080095}