1common_CFLAGS = [
2    "-D_GNU_SOURCE",
3    "-Wall",
4    "-Werror",
5    "-W",
6    "-Wundef",
7    "-Wshadow",
8    "-Wno-error=missing-noreturn",
9    "-Wmissing-format-attribute",
10]
11
12cc_library {
13    name: "libsepol",
14    host_supported: true,
15    cflags: common_CFLAGS,
16    srcs: [
17        "src/assertion.c",
18        "src/avrule_block.c",
19        "src/avtab.c",
20        "src/boolean_record.c",
21        "src/booleans.c",
22        "src/conditional.c",
23        "src/constraint.c",
24        "src/context.c",
25        "src/context_record.c",
26        "src/debug.c",
27        "src/ebitmap.c",
28        "src/expand.c",
29        "src/genbools.c",
30        "src/genusers.c",
31        "src/handle.c",
32        "src/hashtab.c",
33        "src/hierarchy.c",
34        "src/iface_record.c",
35        "src/interfaces.c",
36        "src/kernel_to_cil.c",
37        "src/kernel_to_common.c",
38        "src/kernel_to_conf.c",
39        "src/link.c",
40        "src/mls.c",
41        "src/module.c",
42        "src/module_to_cil.c",
43        "src/node_record.c",
44        "src/nodes.c",
45        "src/polcaps.c",
46        "src/policydb.c",
47        "src/policydb_convert.c",
48        "src/policydb_public.c",
49        "src/port_record.c",
50        "src/ports.c",
51        "src/roles.c",
52        "src/services.c",
53        "src/sidtab.c",
54        "src/symtab.c",
55        "src/user_record.c",
56        "src/users.c",
57        "src/util.c",
58        "src/write.c",
59        "cil/src/android.c",
60        "cil/src/cil_binary.c",
61        "cil/src/cil_build_ast.c",
62        "cil/src/cil.c",
63        "cil/src/cil_copy_ast.c",
64        "cil/src/cil_find.c",
65        "cil/src/cil_fqn.c",
66        "cil/src/cil_lexer.l",
67        "cil/src/cil_list.c",
68        "cil/src/cil_log.c",
69        "cil/src/cil_mem.c",
70        "cil/src/cil_parser.c",
71        "cil/src/cil_policy.c",
72        "cil/src/cil_post.c",
73        "cil/src/cil_reset_ast.c",
74        "cil/src/cil_resolve_ast.c",
75        "cil/src/cil_stack.c",
76        "cil/src/cil_strpool.c",
77        "cil/src/cil_symtab.c",
78        "cil/src/cil_tree.c",
79        "cil/src/cil_verify.c",
80        "cil/src/cil_write_ast.c",
81    ],
82    local_include_dirs: [
83        "cil/src",
84        "src",
85    ],
86    export_include_dirs: [
87        "cil/include",
88        "include",
89    ],
90    stl: "none",
91    // The host version of libsepol is loaded by the system python, which does
92    // not have the sanitizer runtimes.
93    target: {
94        host: {
95            sanitize: {
96                never: true,
97            },
98        },
99    },
100}
101
102cc_binary_host {
103    name: "chkcon",
104    srcs: ["utils/chkcon.c"],
105    shared_libs: ["libsepol"],
106    cflags: common_CFLAGS,
107}
108