• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cc_defaults {
2    name: "clatd_defaults",
3
4    cflags: [
5        "-Wall",
6        "-Werror",
7        "-Wunused-parameter",
8
9        // Bug: http://b/33566695
10        "-Wno-address-of-packed-member",
11    ],
12
13    // For MARK_UNSET.
14    header_libs: [
15        "libnetd_client_headers"
16    ],
17}
18
19// Code used both by the daemon and by unit tests.
20filegroup {
21    name: "clatd_common",
22    srcs: [
23        "clatd.c",
24        "dump.c",
25        "getaddr.c",
26        "icmp.c",
27        "ipv4.c",
28        "ipv6.c",
29        "logging.c",
30        "netlink_callbacks.c",
31        "netlink_msg.c",
32        "ring.c",
33        "setif.c",
34        "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    ],
46    static_libs: ["libnl"],
47    shared_libs: [
48        "libcutils",
49        "liblog",
50        "libnetutils",
51    ],
52
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    ],
66}
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",
77    defaults: ["clatd_defaults"],
78    srcs: [
79        ":clatd_common",
80        "clatd_test.cpp"
81    ],
82    static_libs: [
83        "libbase",
84        "libnetd_test_tun_interface",
85        "libnl",
86    ],
87    shared_libs: [
88        "libcutils",
89        "liblog",
90        "libnetutils",
91    ],
92    test_suites: ["device-tests"],
93    require_root: true,
94}
95