blob: 7c1c1df4109851143022be5c043a725ffbd2723b [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 Colittic29e1782020-06-01 08:48:07 +000013 // 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
68// The configuration file.
69prebuilt_etc {
70 name: "clatd.conf",
71 src: "clatd.conf",
72}
73
74// Unit tests.
75cc_test {
76 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090077 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -080078 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090079 ":clatd_common",
80 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -080081 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090082 static_libs: [
83 "libbase",
84 "libnetd_test_tun_interface",
85 "libnl",
86 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080087 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090088 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -080089 "liblog",
90 "libnetutils",
91 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +090092 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -070093 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -080094}