blob: ac9606be42477bbb912ed6fabc933a3ba90b884e [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
Dan Willemsen1e562182018-11-16 12:52:08 -080069// Unit tests.
70cc_test {
71 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090072 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080073 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090074 ":clatd_common",
75 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080076 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090077 static_libs: [
78 "libbase",
79 "libnetd_test_tun_interface",
80 "libnl",
81 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080082 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090083 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -080084 "liblog",
85 "libnetutils",
86 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +090087 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -070088 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -080089}