blob: ac24a003fe18b3200636d116d8716b5de65a247b [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 "clatd.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090024 "dump.c",
25 "getaddr.c",
26 "icmp.c",
27 "ipv4.c",
28 "ipv6.c",
29 "logging.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090030 "netlink_callbacks.c",
31 "netlink_msg.c",
32 "ring.c",
33 "setif.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090034 "translate.c",
35 ],
36}
37
38// The clat daemon.
39cc_binary {
40 name: "clatd",
41 defaults: ["clatd_defaults"],
42 srcs: [
43 ":clatd_common",
44 "main.c"
45 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080046 static_libs: ["libnl"],
47 shared_libs: [
48 "libcutils",
49 "liblog",
50 "libnetutils",
51 ],
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090052
53 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
54 // tests substantially increases build/compile cycle times and doesn't really provide a
55 // security benefit.
56 tidy: true,
57 tidy_checks: [
58 "-*",
59 "cert-*",
60 "clang-analyzer-security*",
61 "android-*",
62 ],
63 tidy_flags: [
64 "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
65 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080066}
67
Dan Willemsen1e562182018-11-16 12:52:08 -080068// Unit tests.
69cc_test {
70 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090071 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080072 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090073 ":clatd_common",
74 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080075 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090076 static_libs: [
77 "libbase",
78 "libnetd_test_tun_interface",
79 "libnl",
80 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080081 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090082 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -080083 "liblog",
84 "libnetutils",
85 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +090086 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -070087 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -080088}