blob: 8585780263331670311c5336f5efbc24185536d3 [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 Colittieb92f482019-01-04 14:59:11 +090013 // For NETID_UNSET and MARK_UNSET.
Dan Willemsen1e562182018-11-16 12:52:08 -080014 include_dirs: ["bionic/libc/dns/include"],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090015
16 // For NETID_USE_LOCAL_NAMESERVERS.
Luke Huangc12af092020-05-28 15:39:52 +080017 header_libs: ["dnsproxyd_protocol_headers"],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090018}
19
20// Code used both by the daemon and by unit tests.
21filegroup {
22 name: "clatd_common",
23 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090024 "config.c",
25 "clatd.c",
26 "dns64.c",
27 "dump.c",
28 "getaddr.c",
29 "icmp.c",
30 "ipv4.c",
31 "ipv6.c",
32 "logging.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090033 "netlink_callbacks.c",
34 "netlink_msg.c",
35 "ring.c",
36 "setif.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090037 "translate.c",
38 ],
39}
40
41// The clat daemon.
42cc_binary {
43 name: "clatd",
44 defaults: ["clatd_defaults"],
45 srcs: [
46 ":clatd_common",
47 "main.c"
48 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080049 static_libs: ["libnl"],
50 shared_libs: [
51 "libcutils",
52 "liblog",
53 "libnetutils",
54 ],
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090055
56 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
57 // tests substantially increases build/compile cycle times and doesn't really provide a
58 // security benefit.
59 tidy: true,
60 tidy_checks: [
61 "-*",
62 "cert-*",
63 "clang-analyzer-security*",
64 "android-*",
65 ],
66 tidy_flags: [
67 "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
68 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080069}
70
71// The configuration file.
72prebuilt_etc {
73 name: "clatd.conf",
74 src: "clatd.conf",
75}
76
77// Unit tests.
78cc_test {
79 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090080 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080081 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090082 ":clatd_common",
83 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080084 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090085 static_libs: [
86 "libbase",
87 "libnetd_test_tun_interface",
88 "libnl",
89 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080090 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090091 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -080092 "liblog",
93 "libnetutils",
94 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +090095 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -070096 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -080097}