blob: 98b4010eebd61d2ca5623a5950a928db6ae63a1c [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.
Dan Willemsen1e562182018-11-16 12:52:08 -080017 header_libs: ["libnetd_client_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",
33 "mtu.c",
34 "netlink_callbacks.c",
35 "netlink_msg.c",
36 "ring.c",
37 "setif.c",
38 "tun.c",
39 "translate.c",
40 ],
41}
42
43// The clat daemon.
44cc_binary {
45 name: "clatd",
46 defaults: ["clatd_defaults"],
47 srcs: [
48 ":clatd_common",
49 "main.c"
50 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080051 static_libs: ["libnl"],
52 shared_libs: [
53 "libcutils",
54 "liblog",
55 "libnetutils",
56 ],
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090057
58 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
59 // tests substantially increases build/compile cycle times and doesn't really provide a
60 // security benefit.
61 tidy: true,
62 tidy_checks: [
63 "-*",
64 "cert-*",
65 "clang-analyzer-security*",
66 "android-*",
67 ],
68 tidy_flags: [
69 "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
70 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080071}
72
73// The configuration file.
74prebuilt_etc {
75 name: "clatd.conf",
76 src: "clatd.conf",
77}
78
79// Unit tests.
80cc_test {
81 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090082 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080083 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090084 ":clatd_common",
85 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080086 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090087 static_libs: [
88 "libbase",
89 "libnetd_test_tun_interface",
90 "libnl",
91 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080092 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090093 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -080094 "liblog",
95 "libnetutils",
96 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +090097 test_suites: ["device-tests"],
Dan Willemsen1e562182018-11-16 12:52:08 -080098}
99
100// Microbenchmark.
101cc_test {
102 name: "clatd_microbenchmark",
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900103 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -0800104 srcs: [
105 "clatd_microbenchmark.c",
Dan Willemsen1e562182018-11-16 12:52:08 -0800106 "tun.c",
107 ],
Lorenzo Colitti98de5952019-01-20 11:45:03 +0900108 shared_libs: [
109 "libnetutils",
110 ],
Dan Willemsen1e562182018-11-16 12:52:08 -0800111}