blob: 4ab797f8cec86dbb81076bf2aef8e1e25d9a620d [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 ],
Lorenzo Colitti92928722021-01-18 17:40:34 +090066 // Actually not required for clatd itself. See comments in the rc file.
67 init_rc: [
68 "vendor-464xlat.rc",
69 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080070}
71
Dan Willemsen1e562182018-11-16 12:52:08 -080072// Unit tests.
73cc_test {
74 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090075 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080076 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090077 ":clatd_common",
78 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080079 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090080 static_libs: [
81 "libbase",
82 "libnetd_test_tun_interface",
83 "libnl",
84 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080085 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090086 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -080087 "liblog",
88 "libnetutils",
89 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +090090 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -070091 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -080092}